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: 定时任务取消定时工具

samast7fd6979fb26a
diff --git a/jiuwenclaw/agentserver/interface.py b/jiuwenclaw/agentserver/interface.py
index 2778d7b643..1f958ec5b6 100644
--- a/jiuwenclaw/agentserver/interface.py
+++ b/jiuwenclaw/agentserver/interface.py
@@ -394,6 +394,15 @@ class JiuWenClaw:
if isinstance(tool, ToolCard):
if tool.name.startswith("todo_"):
self._instance.ability_manager.remove(tool.name)
+ elif tool.name.startswith("cron_"):
+ self._instance.ability_manager.remove(tool.name)
+
+ # 定时工具
+ if session_id.split('_')[0] not in ["heartbeat", "cron"]:
+ cron_controller = CronController.get_instance()
+ for cron_tool in cron_controller.get_tools():
+ Runner.resource_mgr.add_tool(cron_tool)
+ self._instance.ability_manager.add(cron_tool.card)
effective_session_id = session_id or "default"
if mode == "plan":