diff --git a/src/bus/message.rs b/src/bus/message.rs index d319900..880bbe6 100644 --- a/src/bus/message.rs +++ b/src/bus/message.rs @@ -164,7 +164,6 @@ pub struct InboundMessage { pub channel: String, pub sender_id: String, pub chat_id: String, - pub dialog_id: Option, pub content: String, pub timestamp: i64, pub media: Vec, diff --git a/src/channels/cli_chat.rs b/src/channels/cli_chat.rs index e078de1..963edef 100644 --- a/src/channels/cli_chat.rs +++ b/src/channels/cli_chat.rs @@ -117,7 +117,6 @@ impl CliChatChannel { channel: self.name().to_string(), sender_id: "cli".to_string(), chat_id: chat_id.unwrap_or_else(short_id), - dialog_id: None, content, timestamp: crate::bus::message::current_timestamp(), media: Vec::new(), diff --git a/src/channels/feishu.rs b/src/channels/feishu.rs index f0b6e9f..7329618 100644 --- a/src/channels/feishu.rs +++ b/src/channels/feishu.rs @@ -1110,7 +1110,6 @@ impl FeishuChannel { channel: "feishu".to_string(), sender_id: parsed.open_id.clone(), chat_id: parsed.chat_id.clone(), - dialog_id: None, // Use default/current dialog content: parsed.content.clone(), timestamp: crate::bus::message::current_timestamp(), media: parsed.media.map(|m| vec![m]).unwrap_or_default(), diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs index 6a002bf..b9cea73 100644 --- a/src/gateway/mod.rs +++ b/src/gateway/mod.rs @@ -107,7 +107,6 @@ impl GatewayState { &inbound.channel, &inbound.sender_id, &inbound.chat_id, - inbound.dialog_id.as_deref(), &inbound.content, inbound.media, ).await { diff --git a/src/session/session.rs b/src/session/session.rs index 0df2adf..29f7e8f 100644 --- a/src/session/session.rs +++ b/src/session/session.rs @@ -1039,15 +1039,11 @@ impl SessionManager { channel: &str, _sender_id: &str, chat_id: &str, - dialog_id: Option<&str>, content: &str, media: Vec, ) -> Result { - // Determine dialog_id: if not provided, use current session or find active or create new - let unified_id = if let Some(did) = dialog_id { - UnifiedSessionId::new(channel, chat_id, did) - } else { - // Check if we have a current session tracked for this channel:chat_id + // Channel messages never carry dialog_id — routing is entirely via current_sessions + let unified_id = { let chat_scope = format!("{}:{}", channel, chat_id); let current_session_id = { let inner = self.inner.lock().await; @@ -1056,8 +1052,8 @@ impl SessionManager { if let Some(current_id) = current_session_id { // Verify current session still exists in Storage match self.storage.get_session(¤t_id).await { - Ok(meta) => { - // Current session still valid + Ok(_) => { + // Current session still valid, extract dialog_id let parts: Vec<&str> = current_id.split(':').collect(); if parts.len() == 3 { UnifiedSessionId::new(channel, chat_id, parts[2])