From dc1d566db3c8c96d44f0cd28be09b00d911cfe8b Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Sat, 15 Nov 2025 16:43:23 +0800 Subject: [PATCH] fix: clarify wait tool and todo prompts --- core/main_terminal.py | 2 +- modules/todo_manager.py | 10 ++-------- sub_agent/modules/todo_manager.py | 10 ++-------- sub_agent/prompts/todo_guidelines.txt | 2 +- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/core/main_terminal.py b/core/main_terminal.py index 1edb9c2..c2888c8 100644 --- a/core/main_terminal.py +++ b/core/main_terminal.py @@ -1397,7 +1397,7 @@ class MainTerminal: "type": "function", "function": { "name": "wait_sub_agent", - "description": "等待指定子智能体任务结束(或超时)。任务完成后会返回交付目录,并将结果复制到指定的项目文件夹。", + "description": "等待指定子智能体任务结束(或超时)。任务完成后会返回交付目录,并将结果复制到指定的项目文件夹。调用时 `timeout_seconds` 应不少于对应子智能体的 `timeout_seconds`,否则可能提前终止等待。", "parameters": { "type": "object", "properties": { diff --git a/modules/todo_manager.py b/modules/todo_manager.py index 4831d8f..a198444 100644 --- a/modules/todo_manager.py +++ b/modules/todo_manager.py @@ -68,10 +68,7 @@ class TodoManager: overview = (overview or "").strip() if not overview: - return { - "success": False, - "error": "任务概述不能为空。请用一句话概括清单目标,例如“整理比亚迪新能源销量数据”。" - } + return {"success": False, "error": "任务概述不能为空。"} if len(overview) > self.MAX_OVERVIEW_LENGTH: return { "success": False, @@ -80,10 +77,7 @@ class TodoManager: normalized_tasks = self._normalize_tasks(tasks or []) if not normalized_tasks: - return { - "success": False, - "error": "需要至少提供一个任务。每个任务应是可执行的步骤,如“收集车型销量数据”而不是“处理”这类模糊词。" - } + return {"success": False, "error": "需要至少提供一个任务。"} if len(tasks or []) > self.MAX_TASKS: return { "success": False, diff --git a/sub_agent/modules/todo_manager.py b/sub_agent/modules/todo_manager.py index 9f274e8..a198444 100644 --- a/sub_agent/modules/todo_manager.py +++ b/sub_agent/modules/todo_manager.py @@ -68,10 +68,7 @@ class TodoManager: overview = (overview or "").strip() if not overview: - return { - "success": False, - "error": "任务概述不能为空。请用一句话概括清单目标,例如“整理车型销量”或“编写 result.md”。" - } + return {"success": False, "error": "任务概述不能为空。"} if len(overview) > self.MAX_OVERVIEW_LENGTH: return { "success": False, @@ -80,10 +77,7 @@ class TodoManager: normalized_tasks = self._normalize_tasks(tasks or []) if not normalized_tasks: - return { - "success": False, - "error": "需要至少提供一个任务。请把计划分成可执行的小步骤,例如“读取文件”“整理总结”等。" - } + return {"success": False, "error": "需要至少提供一个任务。"} if len(tasks or []) > self.MAX_TASKS: return { "success": False, diff --git a/sub_agent/prompts/todo_guidelines.txt b/sub_agent/prompts/todo_guidelines.txt index 2f346cc..fae2617 100644 --- a/sub_agent/prompts/todo_guidelines.txt +++ b/sub_agent/prompts/todo_guidelines.txt @@ -14,7 +14,7 @@ ## 使用流程 1. **先规划**:在创建清单前,用自然语言写下你准备执行的流程,让自己确认无遗漏。 -2. **todo_create**:把概述与任务数组一次性写对,创建后尽量不要反复删除重建。概述 ≤ 50 字,直接写清“我要做什么”;任务数组列出 2~4 条动词+对象的步骤,例如“读取 physics_problems.txt”“整理 result.md 结论”。 +2. **todo_create**:把概述与任务数组一次性写对,创建后尽量不要反复删除重建。概述 ≤ 50 字,直接写清“我要做什么”(例如“整理 deliverables/result.md”);任务数组写 2~4 条“动词+对象+目标”的步骤,例如“读取 physics_problems.txt,列出 5 道题”“在 result.md 中总结风险”。 3. **todo_update_task**:每完成一项立刻勾选;若步骤发生变化,先写明原因再修改对应任务。 4. **todo_finish**:所有任务完成后调用。若仍有未完项但必须停止,先调用 `todo_finish`,再用 `todo_finish_confirm` 说明原因与后续建议。