MoonshotAI / MoonshotAI/kimi-code

[Bug] agent-core v1 Agent tool description says "fixed 30-minute timeout", actual default is 2 hours

Open Beginner friendly
#2,420 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Stale descriptionpackages/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_BASE via ?raw import in agent.ts), so every v1 session injects this text into the model's context.

  2. Actual default is 2 hourspackages/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.

  3. A test locks in the stale textpackages/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.

  4. v2 is aligned, v1 is notpackages/agent-core-v2/src/session/subagent/tools/agent.md:12 correctly 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

  1. Update packages/agent-core/src/tools/builtin/collaboration/agent.md:12 to match the constant (as v2 does), and update the assertion in packages/agent-core/test/tools/agent.test.ts:131.
  2. Better still: render the timeout in the description from formatSubagentTimeoutDescription(resolveSubagentTimeoutMs(...)) so the text cannot drift from the code again.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.