From 036bdafd1ec6f237f424cf396bd62dbf30f4650c Mon Sep 17 00:00:00 2001 From: kurihada Date: Wed, 17 Dec 2025 14:18:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor(core):=20task=5Foutput=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=BD=BF=E7=94=A8=E5=A4=96=E9=83=A8=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/src/tools/descriptions/task/task_output.txt | 7 +++++++ packages/core/src/tools/task/task_output.ts | 11 ++--------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 packages/core/src/tools/descriptions/task/task_output.txt diff --git a/packages/core/src/tools/descriptions/task/task_output.txt b/packages/core/src/tools/descriptions/task/task_output.txt new file mode 100644 index 0000000..61c5227 --- /dev/null +++ b/packages/core/src/tools/descriptions/task/task_output.txt @@ -0,0 +1,7 @@ +- Retrieves output from a running or completed task (background shell, agent, or remote session) +- Takes a task_id parameter identifying the task +- Returns the task output along with status information +- Use block=true (default) to wait for task completion +- Use block=false for non-blocking check of current status +- Task IDs can be found using the /tasks command +- Works with all task types: background shells, async agents, and remote sessions diff --git a/packages/core/src/tools/task/task_output.ts b/packages/core/src/tools/task/task_output.ts index 673522f..da32573 100644 --- a/packages/core/src/tools/task/task_output.ts +++ b/packages/core/src/tools/task/task_output.ts @@ -1,5 +1,6 @@ import type { ToolWithMetadata } from '../types.js'; import { getAgentManager } from '../../agent/manager.js'; +import { loadDescription } from '../load_description.js'; /** * TaskOutput 工具 @@ -7,15 +8,7 @@ import { getAgentManager } from '../../agent/manager.js'; */ export const taskOutputTool: ToolWithMetadata = { name: 'task_output', - description: `获取后台运行的 Agent 执行结果。 - -当使用 task 工具的 run_in_background 参数启动后台 Agent 后, -使用此工具查询执行状态和结果。 - -使用示例: -- 查询结果(阻塞等待): task_output({ task_id: "abc123" }) -- 检查状态(不阻塞): task_output({ task_id: "abc123", block: false }) -- 设置超时: task_output({ task_id: "abc123", timeout: 60000 })`, + description: loadDescription('task_output'), parameters: { task_id: { type: 'string',