Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(cron): In web channel, create a new session, do not display push cron tasks

wncbdj5b33da2638a0
diff --git a/jiuwenswarm/gateway/cron/scheduler.py b/jiuwenswarm/gateway/cron/scheduler.py
index c61e6bf32c..041961d53b 100644
--- a/jiuwenswarm/gateway/cron/scheduler.py
+++ b/jiuwenswarm/gateway/cron/scheduler.py
@@ -525,11 +525,11 @@ class CronSchedulerService:
# 企业飞书:优先用作业里绑定的 SessionMap session_id(feishu::chat_id::bot_id::...),
# 避免多群共用 bot 时误用 config 中的 last_*(最近一条消息的会话)。
- # TUI:不绑定 session_id,否则 TUI 重启后新 session_id 与旧不同,消息会被前端过滤。
+ # Web/TUI:不绑定 session_id,否则新会话或重启后 session_id 与旧不同,消息会被前端过滤。
metadata: dict | None = None
msg_session_id: str | None = None
routing_sid = str(getattr(job, "session_id", None) or "").strip()
- if routing_sid and channel_id != "tui":
+ if routing_sid and channel_id not in ("web", "tui"):
msg_session_id = routing_sid
if channel_id.startswith("feishu_enterprise:") and routing_sid and "::" in routing_sid:
parts = routing_sid.split("::")