MoonshotAI / MoonshotAI/kimi-code
[Bug] v1 engine Agent tool description still claims "fixed 30-minute timeout" (actual default: 2 hours)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
[Bug] v1 engine Agent tool description still claims "fixed 30-minute timeout" (actual default: 2 hours)
Summary
The v1 engine's Agent tool description tells the model that subagents use "a fixed 30-minute timeout", but the actual default has been 2 hours since v0.23.6. Because the interactive CLI defaults to the v1 engine, this stale text is what most sessions inject into the model's context.
The timeout enforcement is correct (2h, configurable) — only the LLM-facing description is wrong.
Environment
- kimi-code 0.26.0 (latest release, published 2026-07-16; verified via the auto-updater manifest)
- Linux x86-64, interactive TUI mode (default v1 engine)
Evidence
-
Stale description (v1) —
packages/agent-core/src/tools/builtin/collaboration/agent.md:12:Subagents use a fixed 30-minute timeout. If one times out, resume the same agent instead of starting over.
This file is embedded verbatim into the tool description (
AGENT_DESCRIPTION_BASEvia?rawimport inagent.ts), so every v1-engine session shows the model this text. -
Test enshrines the stale text —
packages/agent-core/test/tools/agent.test.ts:131:expect(tool.description).toContain('fixed 30-minute timeout');This assertion was never updated when the default changed, which is why the drift went unnoticed.
-
Actual default is 2 hours —
packages/agent-core/src/session/subagent-host.ts:33:export const DEFAULT_SUBAGENT_TIMEOUT_MS = 2 * 60 * 60 * 1000;Overridable via
[subagent] timeout_msin config.toml orKIMI_SUBAGENT_TIMEOUT_MS(env takes precedence). -
History:
- #1562 (v0.23.6) — added
subagent.timeout_msand raised the default from 30 minutes to 2 hours. - #1704 (v0.24.2) — aligned the subagent timeout across engines (fixed 2-hour default).
- The v2 description was updated accordingly —
packages/agent-core-v2/src/session/subagent/tools/agent.md:12now reads "Subagents use a fixed 2-hour timeout", andagent-core-v2/test/tool/tool.test.ts:454asserts it. The v1 copy was missed.
- #1562 (v0.23.6) — added
-
Runtime confirmation: a 0.26.0 interactive session's injected
Agenttool description matches the v1agent.mdverbatim (30-minute wording), and the shipped 0.26.0 binary contains both the "30-minute" (v1) and "2-hour" (v2) strings.
Impact
- The model plans around a nonexistent 30-minute cap: it may unnecessarily split long delegations, or resume subagents believing they were killed by a 30-minute deadline.
- The word "fixed" also hides the fact that the timeout is configurable (
[subagent] timeout_ms/KIMI_SUBAGENT_TIMEOUT_MS), so neither the model nor users reading logs learn about the escape hatch. - No functional breakage: actual enforcement is 2 hours in both engines, foreground, background, and AgentSwarm alike.
Suggested fix
- Update
packages/agent-core/src/tools/builtin/collaboration/agent.md:12to match v2 ("fixed 2-hour timeout"), or better: render the value dynamically (e.g. viaformatSubagentTimeoutDescription(resolveSubagentTimeoutMs(...))) so the description cannot drift from the code again. - Update the assertion in
packages/agent-core/test/tools/agent.test.ts:131accordingly. - (Optional) Mention in the description that the timeout is configurable, e.g. "Subagents use a 2-hour timeout by default, configurable via
[subagent] timeout_ms."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/agent-core/src/tools/builtin/collaboration/agent.md and compare its Agent description with the v2 copy at packages/agent-core-v2/src/session/subagent/tools/agent.md. Update the v1 wording and the matching assertion in packages/agent-core/test/tools/agent.test.ts, then run that test file. Done means the v1 description and test reflect the current two-hour default without changing timeout enforcement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, testing, tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100