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: Fixed the issue where scheduled task notifications were not displaying on the frontend after being sent

wncbdjc27a42fb2936
diff --git a/jiuwenclaw/agentserver/deep_agent/cron_runtime.py b/jiuwenclaw/agentserver/deep_agent/cron_runtime.py
index 9ff7c25fe3..d247481a2c 100644
--- a/jiuwenclaw/agentserver/deep_agent/cron_runtime.py
+++ b/jiuwenclaw/agentserver/deep_agent/cron_runtime.py
@@ -305,6 +305,14 @@ def _extract_legacy_params(
if "deleteAfterRun" in data:
out["delete_after_run"] = bool(data.get("deleteAfterRun"))
+ context_session_id = getattr(context, "session_id", None)
+ if isinstance(context_session_id, str) and context_session_id.strip():
+ out["session_id"] = context_session_id.strip()
+ logger.info(
+ "[CronRuntimeBridge] _extract_legacy_params: added session_id=%s from context",
+ out["session_id"],
+ )
+
context_mode = getattr(context, "mode", None)
mode_resolved = (
context_mode
diff --git a/jiuwenclaw/agentserver/tools/cron_tools.py b/jiuwenclaw/agentserver/tools/cron_tools.py
index 2e0fd35ae3..e7b18be32f 100644
--- a/jiuwenclaw/agentserver/tools/cron_tools.py
+++ b/jiuwenclaw/agentserver/tools/cron_tools.py
@@ -235,10 +235,9 @@ class CronTools:
targets_str,
)
session_kw: dict[str, Any] = {}
- if str(targets_str).strip().startswith("feishu_enterprise:"):
- sid = self._route().session_id
- if isinstance(sid, str) and sid.strip():
- session_kw["session_id"] = sid.strip()
+ sid = self._route().session_id
+ if isinstance(sid, str) and sid.strip():
+ session_kw["session_id"] = sid.strip()
chat_type = self._route().chat_type
if chat_type:
session_kw["chat_type"] = chat_type
diff --git a/jiuwenclaw/gateway/cron/scheduler.py b/jiuwenclaw/gateway/cron/scheduler.py
index 9fe2d61acb..7916df4456 100644
--- a/jiuwenclaw/gateway/cron/scheduler.py
+++ b/jiuwenclaw/gateway/cron/scheduler.py
@@ -490,6 +490,8 @@ class CronSchedulerService:
metadata: dict | None = None
msg_session_id: str | None = None
routing_sid = str(getattr(job, "session_id", None) or "").strip()
+ if routing_sid:
+ msg_session_id = routing_sid
if channel_id.startswith("feishu_enterprise:") and routing_sid and "::" in routing_sid:
parts = routing_sid.split("::")
if len(parts) >= 3 and parts[0] == "feishu":