From c2634b5e4092b53a98d7d7aafa37023e34a5fd56 Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 21 Mar 2026 21:54:46 +0100 Subject: [PATCH] Agents: raise default timeout to 48h (#51874) --- CHANGELOG.md | 1 + src/agents/subagent-depth.test.ts | 7 ++++++- src/agents/timeout.ts | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d8e7692bb3..f78682bad57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Agents/default timeout: raise the shared default agent timeout from `600s` to `48h` so long-running ACP and agent sessions do not fail unless you configure a shorter limit. - Gateway/Linux: auto-detect nvm-managed Node TLS CA bundle needs before CLI startup and refresh installed services that are missing `NODE_EXTRA_CA_CERTS`. (#51146) Thanks @GodsBoy. - CLI/config: make `config set --strict-json` enforce real JSON, prefer `JSON.parse` with JSON5 fallback for machine-written cron/subagent stores, and relabel raw config surfaces as `JSON/JSON5` to match actual compatibility. Related: #48415, #43127, #14529, #21332. Thanks @adhitShet and @vincentkoc. - CLI/Ollama onboarding: keep the interactive model picker for explicit `openclaw onboard --auth-choice ollama` runs so setup still selects a default model without reintroducing pre-picker auto-pulls. (#49249) Thanks @BruceMacD. diff --git a/src/agents/subagent-depth.test.ts b/src/agents/subagent-depth.test.ts index 2c62432a692..f52ecf9b9cf 100644 --- a/src/agents/subagent-depth.test.ts +++ b/src/agents/subagent-depth.test.ts @@ -3,7 +3,7 @@ import os from "node:os"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { getSubagentDepthFromSessionStore } from "./subagent-depth.js"; -import { resolveAgentTimeoutMs } from "./timeout.js"; +import { resolveAgentTimeoutMs, resolveAgentTimeoutSeconds } from "./timeout.js"; describe("getSubagentDepthFromSessionStore", () => { it("uses spawnDepth from the session store when available", () => { @@ -115,6 +115,11 @@ describe("getSubagentDepthFromSessionStore", () => { }); describe("resolveAgentTimeoutMs", () => { + it("defaults to 48 hours when config does not override the timeout", () => { + expect(resolveAgentTimeoutSeconds()).toBe(48 * 60 * 60); + expect(resolveAgentTimeoutMs({})).toBe(48 * 60 * 60 * 1000); + }); + it("uses a timer-safe sentinel for no-timeout overrides", () => { expect(resolveAgentTimeoutMs({ overrideSeconds: 0 })).toBe(2_147_000_000); expect(resolveAgentTimeoutMs({ overrideMs: 0 })).toBe(2_147_000_000); diff --git a/src/agents/timeout.ts b/src/agents/timeout.ts index 56970a11852..9743b449109 100644 --- a/src/agents/timeout.ts +++ b/src/agents/timeout.ts @@ -1,6 +1,6 @@ import type { OpenClawConfig } from "../config/config.js"; -const DEFAULT_AGENT_TIMEOUT_SECONDS = 600; +const DEFAULT_AGENT_TIMEOUT_SECONDS = 48 * 60 * 60; const MAX_SAFE_TIMEOUT_MS = 2_147_000_000; const normalizeNumber = (value: unknown): number | undefined =>