diff --git a/packages/core/src/agent/subagent/README.md b/packages/core/src/agent/subagent/README.md index e007eab1..9455cde9 100644 --- a/packages/core/src/agent/subagent/README.md +++ b/packages/core/src/agent/subagent/README.md @@ -123,7 +123,7 @@ The subagent system allows a parent agent to spawn isolated child agents that ru | `announce.ts` | System prompt builder, findings reader, message formatter, delivery | | `announce-queue.ts` | Debounced queue for batching announcements when parent is busy | | `command-queue.ts` | Concurrency limiter for subagent lane slots | -| `lanes.ts` | Lane config: max concurrency (10), default timeout (600s) | +| `lanes.ts` | Lane config: max concurrency (10), default timeout (1800s) | | `types.ts` | Shared types: SubagentRunRecord, SubagentRunOutcome, etc. | | `registry-store.ts` | Persistence: save/load runs to disk for crash recovery | @@ -159,10 +159,10 @@ Child run error (e.g., missing API key for provider) ## Timeout Behavior -Default: 600s (10 min). System prompt guides the parent LLM: -- Simple tasks: 600s (default) -- Moderate tasks: 900-1200s (15-20 min) -- Complex tasks: 1200-1800s (20-30 min) +Default: 1800s (30 min). System prompt guides the parent LLM: +- Simple tasks: 1800s (default) +- Moderate tasks: 1800-2400s (30-40 min) +- Complex tasks: 2400-3600s (40-60 min) On timeout: 1. Timeout timer fires in `watchChildAgent()` diff --git a/packages/core/src/agent/subagent/lanes.ts b/packages/core/src/agent/subagent/lanes.ts index 88649722..87bfecc3 100644 --- a/packages/core/src/agent/subagent/lanes.ts +++ b/packages/core/src/agent/subagent/lanes.ts @@ -10,8 +10,8 @@ export const DEFAULT_SUBAGENT_MAX_CONCURRENT = 10; // Timeout defaults // --------------------------------------------------------------------------- -/** Default subagent timeout: 10 minutes. */ -export const DEFAULT_SUBAGENT_TIMEOUT_SECONDS = 600; +/** Default subagent timeout: 30 minutes. */ +export const DEFAULT_SUBAGENT_TIMEOUT_SECONDS = 1800; /** Maximum safe value for setTimeout (~24.8 days). */ const MAX_SAFE_TIMEOUT_MS = 2_147_000_000; @@ -19,7 +19,7 @@ const MAX_SAFE_TIMEOUT_MS = 2_147_000_000; /** * Resolve the effective timeout in milliseconds for a subagent run. * - * - `undefined` / negative → default (600 s) + * - `undefined` / negative → default (1800 s) * - `0` → no timeout (MAX_SAFE_TIMEOUT_MS) * - positive number → use as-is, clamped to safe range */ diff --git a/packages/core/src/agent/subagent/registry.ts b/packages/core/src/agent/subagent/registry.ts index 8a311561..eaff0158 100644 --- a/packages/core/src/agent/subagent/registry.ts +++ b/packages/core/src/agent/subagent/registry.ts @@ -273,7 +273,7 @@ function watchChildAgent(record: SubagentRunRecord, timeoutSeconds?: number): Pr resolveSlot(); // Release the queue slot }; - // Always set a timeout (default 10 min, 0 = ~24 days via resolveSubagentTimeoutMs) + // Always set a timeout (default 30 min, 0 = ~24 days via resolveSubagentTimeoutMs) const timeoutTimer = setTimeout(() => { cleanup({ status: "timeout" }); diff --git a/packages/core/src/agent/system-prompt/sections.ts b/packages/core/src/agent/system-prompt/sections.ts index 5236affa..bc0bc6ed 100644 --- a/packages/core/src/agent/system-prompt/sections.ts +++ b/packages/core/src/agent/system-prompt/sections.ts @@ -299,9 +299,9 @@ export function buildConditionalToolSections( "", "### Timeout Guidelines", "Set timeoutSeconds generously — a sub-agent that times out loses all its work.", - "- Simple tasks (search, read, summarize): 600 (10 min, the default)", - "- Moderate tasks (multi-step research, file downloads + analysis): 900–1200 (15–20 min)", - "- Complex tasks (code generation, PDF creation, multi-file operations): 1200–1800 (20–30 min)", + "- Simple tasks (search, read, summarize): 1800 (30 min, the default)", + "- Moderate tasks (multi-step research, file downloads + analysis): 1800–2400 (30–40 min)", + "- Complex tasks (code generation, PDF creation, multi-file operations): 2400–3600 (40–60 min)", "When in doubt, use a longer timeout.", "", ); diff --git a/packages/core/src/agent/tools/sessions-spawn.ts b/packages/core/src/agent/tools/sessions-spawn.ts index 87ba89dc..63e615bb 100644 --- a/packages/core/src/agent/tools/sessions-spawn.ts +++ b/packages/core/src/agent/tools/sessions-spawn.ts @@ -29,7 +29,7 @@ const SessionsSpawnSchema = Type.Object({ timeoutSeconds: Type.Optional( Type.Number({ description: - "Execution timeout in seconds. Default: 600 (10 min). " + + "Execution timeout in seconds. Default: 1800 (30 min). " + "Set to 0 for no timeout (useful for complex, long-running tasks). " + "The subagent will be terminated if it exceeds this limit.", minimum: 0,