Skip to content

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

Description

@starquakee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions