fix(bootstrap): set agents.defaults.timeoutSeconds=86400 to prevent premature termination

OpenClaw's default agent timeout is 600s (10 min), which consistently kills
long-running agent responses — especially multi-file code generation and
complex multi-tool-call workflows. This triggers:

- 'terminated' errors mid-stream (webchat shows terminated banner)
- Retry storms: same runId retries ~60s apart, then new runIds also fail
- Follow-up messages silently dropped (shouldSkipMessageByAbortCutoff)

Set the default to 86400s (24 hours) during bootstrap so all DenchClaw
installations get a sane timeout out of the box. Note: the runtime code
supports timeoutSeconds=0 (no timeout) but the config schema validation
rejects 0 (exclusiveMinimum: 0), so 86400 is the practical maximum.

Also rename ensureSubagentDefaults -> ensureAgentDefaults since the function
now configures both agent-level and subagent-level settings.

Refs:
- https://github.com/openclaw/openclaw/issues/30487
- https://github.com/openclaw/openclaw/issues/46049
- https://github.com/openclaw/openclaw/issues/30083
This commit is contained in:
kumarabhirup 2026-03-18 13:50:56 -07:00
parent 351b71fd05
commit 104628ed9c
No known key found for this signature in database
GPG Key ID: DB7CA2289CAB0167

View File

@ -717,8 +717,15 @@ function stagePreOnboardConfig(
);
}
async function ensureSubagentDefaults(openclawCommand: string, profile: string): Promise<void> {
async function ensureAgentDefaults(openclawCommand: string, profile: string): Promise<void> {
const settings: Array<[string, string]> = [
// Set agent timeout to 24 hours to prevent long-running agent runs from
// being terminated prematurely. OpenClaw's default is 600s (10 min) which
// consistently kills complex multi-tool-call responses and triggers retry
// storms + silently dropped follow-up messages.
// See: https://github.com/openclaw/openclaw/issues/30487
// https://github.com/openclaw/openclaw/issues/46049
["agents.defaults.timeoutSeconds", "86400"],
["agents.defaults.subagents.maxConcurrent", "8"],
["agents.defaults.subagents.maxSpawnDepth", "2"],
["agents.defaults.subagents.maxChildrenPerAgent", "10"],
@ -2418,8 +2425,8 @@ export async function bootstrapCommand(
plugins: managedBundledPlugins,
});
postOnboardSpinner?.message("Configuring subagent defaults…");
await ensureSubagentDefaults(openclawCommand, profile);
postOnboardSpinner?.message("Configuring agent defaults…");
await ensureAgentDefaults(openclawCommand, profile);
// ── Gateway daemon restart + readiness verification ──
// Skipped entirely in daemonless mode — the user manages the gateway process