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_BASE via ?raw import in agent.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: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
- 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.
- Better still: render the timeout in the description from
formatSubagentTimeoutDescription(resolveSubagentTimeoutMs(...)) so the text cannot drift from the code again.
Summary
In
agent-core(v1), theAgenttool 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: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: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: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
KIMI_SUBAGENT_TIMEOUT_MS/[subagent] timeout_ms).Suggested fix
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.formatSubagentTimeoutDescription(resolveSubagentTimeoutMs(...))so the text cannot drift from the code again.