Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/agent-timeout-description-2h.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Describe the timeout as a default, not fixed

When deployments set [subagent] timeout_ms or KIMI_SUBAGENT_TIMEOUT_MS, the Agent tool is registered with that resolved value (resolveSubagentTimeoutMs(...), with 0 meaning no timeout), so this changed prompt now tells the model every subagent has a fixed 2-hour deadline even when the real deadline is shorter, longer, or disabled. That can make the model plan background delegation or timeout recovery around the wrong limit; please describe 2 hours as the default or render the resolved timeout in the tool description.

Useful? React with 👍 / 👎.


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.

Expand Down
2 changes: 1 addition & 1 deletion packages/agent-core/test/tools/agent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down