MoonshotAI / MoonshotAI/kimi-code
[Bug] agent-core v1 Agent tool description says "fixed 30-minute timeout", actual default is 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
Summary
In agent-core (v1), the Agent tool description tells the model that subagents use "a fixed 30-minute timeout", but the enforced default is 2 hours. The model-facing text and the runtime constant disagree, and a test assertion pins the stale text so nothing flags the drift.
Evidence
-
Stale description —
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 session injects this text into the model's context. -
Actual default is 2 hours —
packages/agent-core/src/session/subagent-host.ts:33:export const DEFAULT_SUBAGENT_TIMEOUT_MS = 2 * 60 * 60 * 1000;Effective resolution:
KIMI_SUBAGENT_TIMEOUT_MS(env) →[subagent] timeout_ms(config.toml) → this constant. -
A test locks in the stale text —
packages/agent-core/test/tools/agent.test.ts:131:expect(tool.description).toContain('fixed 30-minute timeout');Execution-side tests use the constant itself, so everything stays green while the two sides disagree.
-
v2 is aligned, v1 is not —
packages/agent-core-v2/src/session/subagent/tools/agent.md:12correctly reads "Subagents use a fixed 2-hour timeout".
Impact
- The model plans around a nonexistent 30-minute cap: it may split long delegations unnecessarily, or assume a subagent was killed at 30 minutes when it actually had 2 hours.
- The word "fixed" also hides that the timeout is configurable (
KIMI_SUBAGENT_TIMEOUT_MS/[subagent] timeout_ms). - No functional breakage: enforcement is 2 hours; only the LLM-facing description is wrong.
Suggested fix
- Update
packages/agent-core/src/tools/builtin/collaboration/agent.md:12to match the constant (as v2 does), and update the assertion inpackages/agent-core/test/tools/agent.test.ts:131. - Better still: render the timeout in the description from
formatSubagentTimeoutDescription(resolveSubagentTimeoutMs(...))so the text cannot drift from the code again.
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 packages/agent-core/src/session/subagent-host.ts, then inspect the AGENT_DESCRIPTION_BASE import in agent.ts. Check packages/agent-core/test/tools/agent.test.ts and its timeout assertion. Done means the v1 description reflects the configured timeout and the test verifies the corrected behavior without drift.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100