From a795ee2c4cef641aecf0cd38b38e88b0d2b1cc98 Mon Sep 17 00:00:00 2001 From: mangeshraut712 Date: Thu, 30 Jul 2026 23:12:48 +0530 Subject: [PATCH] fix(agent-core): align Agent tool timeout description with 2-hour default The embedded Agent tool markdown still said subagents use a fixed 30-minute timeout after the runtime default moved to 2 hours. Update the description and the locking unit test so model-facing text matches DEFAULT_SUBAGENT_TIMEOUT_MS. Fixes #2420 --- .changeset/agent-timeout-description-2h.md | 6 ++++++ .../agent-core/src/tools/builtin/collaboration/agent.md | 2 +- packages/agent-core/test/tools/agent.test.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/agent-timeout-description-2h.md diff --git a/.changeset/agent-timeout-description-2h.md b/.changeset/agent-timeout-description-2h.md new file mode 100644 index 0000000000..7178f93f3f --- /dev/null +++ b/.changeset/agent-timeout-description-2h.md @@ -0,0 +1,6 @@ +--- +"@moonshot-ai/agent-core": patch +"@moonshot-ai/kimi-code": patch +--- + +Align the Agent tool description with the 2-hour default subagent timeout so the model no longer plans around a stale 30-minute cap. diff --git a/packages/agent-core/src/tools/builtin/collaboration/agent.md b/packages/agent-core/src/tools/builtin/collaboration/agent.md index ec0533e7ef..d8b65d7c0d 100644 --- a/packages/agent-core/src/tools/builtin/collaboration/agent.md +++ b/packages/agent-core/src/tools/builtin/collaboration/agent.md @@ -9,7 +9,7 @@ Writing the prompt: Usage notes: - When the task continues earlier work a subagent already did, prefer resuming that agent (pass its `resume` id) over spawning a fresh instance — the resumed agent keeps its prior context. - A subagent's result is only visible to you, not to the user. When the user needs to see what a subagent produced, summarize the relevant parts yourself in your own reply. -- Subagents use a fixed 30-minute timeout. If one times out, resume the same agent instead of starting over. +- Subagents use a fixed 2-hour timeout. If one times out, resume the same agent instead of starting over. When NOT to use Agent: skip delegation for trivial work you can do directly — reading a file whose path you already know, searching a small known set of files, or any task that takes only a step or two. Delegation has a context-handoff cost; it pays off only when the task is substantial enough to outweigh it. diff --git a/packages/agent-core/test/tools/agent.test.ts b/packages/agent-core/test/tools/agent.test.ts index 0df5eab03a..daa9de1078 100644 --- a/packages/agent-core/test/tools/agent.test.ts +++ b/packages/agent-core/test/tools/agent.test.ts @@ -128,7 +128,7 @@ describe('AgentTool', () => { const host = mockSubagentHost({ spawn: vi.fn() }); const tool = agentTool(host); - expect(tool.description).toContain('fixed 30-minute timeout'); + expect(tool.description).toContain('fixed 2-hour timeout'); expect(tool.description).not.toContain('operator-configured background timeout'); expect(tool.description).not.toContain('no time limit'); // Background guidance must steer foreground-by-default, so the model doesn't