From 83b525e4423808a96dbfc4db4b30db81bc4cdc9d Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Sat, 9 May 2026 17:20:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=99=9A=E6=8B=9F?= =?UTF-8?q?=E8=B0=83=E5=BA=A6=E5=99=A8=E8=81=8A=E5=A4=A9=20ID=20=E5=89=8D?= =?UTF-8?q?=E7=BC=80=EF=BC=8C=E8=B7=B3=E8=BF=87=E4=B8=8D=E5=BA=94=E5=8F=91?= =?UTF-8?q?=E9=80=81=E5=88=B0=E5=A4=96=E9=83=A8=E9=80=9A=E9=81=93=E7=9A=84?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gateway/outbound_dispatcher.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gateway/outbound_dispatcher.rs b/src/gateway/outbound_dispatcher.rs index 11a37da..a4bfe71 100644 --- a/src/gateway/outbound_dispatcher.rs +++ b/src/gateway/outbound_dispatcher.rs @@ -12,6 +12,9 @@ pub struct OutboundDispatcher { channels: Arc>>>, } +/// Prefix for virtual scheduler chat IDs that should not be sent to external channels. +const SCHEDULER_VIRTUAL_CHAT_ID_PREFIX: &str = "scheduler/"; + impl OutboundDispatcher { pub fn new(bus: Arc) -> Self { Self { @@ -40,6 +43,17 @@ impl OutboundDispatcher { "OutboundDispatcher received message" ); + // Skip messages with virtual scheduler chat IDs (e.g., "scheduler/job_id") + // These are internal messages from SilentAgentTask that should not be sent externally + if msg.chat_id.starts_with(SCHEDULER_VIRTUAL_CHAT_ID_PREFIX) { + tracing::debug!( + channel = %msg.channel, + chat_id = %msg.chat_id, + "Skipping message with virtual scheduler chat_id" + ); + continue; + } + let channel_name = msg.channel.clone(); let channel = self.channels.read().await.get(&channel_name).cloned();