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定时任务超时后不报错也不执行返回结果

openJiuwen-bot86b532f2198a
diff --git a/jiuwenswarm/gateway/cron/scheduler.py b/jiuwenswarm/gateway/cron/scheduler.py
index 041961d53b..fe616b6d3d 100644
--- a/jiuwenswarm/gateway/cron/scheduler.py
+++ b/jiuwenswarm/gateway/cron/scheduler.py
@@ -406,6 +406,9 @@ class CronSchedulerService:
state.error = str(exc)
finally:
state.finished_at = self._now_fn()
+ # Ensure failed runs also produce result_text so push logic can deliver it
+ if not state.result_text and state.error:
+ state.result_text = f"[cron] 任务执行失败: {state.error}"
# if placeholder already sent, push update immediately
if state.placeholder_sent and not state.pushed_final and state.result_text:
logger.info(