惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
博客园 - 聂微东
博客园 - 【当耐特】
博客园_首页
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
V
Visual Studio Blog
F
Fortinet All Blogs
Martin Fowler
Martin Fowler

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: honor Codex dynamic tool timeouts · openclaw/opencla...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -133,6 +133,8 @@ import { createCodexUserInputBridge } from "./user-input-bridge.js";

133133

import { filterToolsForVisionInputs } from "./vision-tools.js";

134134135135

const CODEX_DYNAMIC_TOOL_TIMEOUT_MS = 30_000;

136+

const CODEX_DYNAMIC_TOOL_MAX_TIMEOUT_MS = 600_000;

137+

const CODEX_DYNAMIC_IMAGE_TOOL_TIMEOUT_MS = 60_000;

136138

const CODEX_APP_SERVER_STARTUP_CONNECTION_CLOSE_MAX_ATTEMPTS = 3;

137139

const CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS = 100;

138140

const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 60_000;

@@ -1186,18 +1188,22 @@ export async function runCodexAppServerAttempt(

11861188

...(toolArgs ? { args: toolArgs } : {}),

11871189

},

11881190

});

1191+

const dynamicToolTimeoutMs = resolveDynamicToolCallTimeoutMs({

1192+

call,

1193+

config: params.config,

1194+

});

11891195

const response = await handleDynamicToolCallWithTimeout({

11901196

call,

11911197

toolBridge,

11921198

signal: runAbortController.signal,

1193-

timeoutMs: CODEX_DYNAMIC_TOOL_TIMEOUT_MS,

1199+

timeoutMs: dynamicToolTimeoutMs,

11941200

onTimeout: () => {

11951201

trajectoryRecorder?.recordEvent("tool.timeout", {

11961202

threadId: call.threadId,

11971203

turnId: call.turnId,

11981204

toolCallId: call.callId,

11991205

name: call.tool,

1200-

timeoutMs: CODEX_DYNAMIC_TOOL_TIMEOUT_MS,

1206+

timeoutMs: dynamicToolTimeoutMs,

12011207

});

12021208

},

12031209

});

@@ -1579,7 +1585,7 @@ async function handleDynamicToolCallWithTimeout(params: {

15791585

resolveAbort = resolve;

15801586

});

15811587

const timeoutPromise = new Promise<CodexDynamicToolCallResponse>((resolve) => {

1582-

const timeoutMs = Math.max(1, Math.min(CODEX_DYNAMIC_TOOL_TIMEOUT_MS, params.timeoutMs));

1588+

const timeoutMs = clampDynamicToolTimeoutMs(params.timeoutMs);

15831589

timeout = setTimeout(() => {

15841590

timedOut = true;

15851591

const timeoutDetails = formatDynamicToolTimeoutDetails({ call: params.call, timeoutMs });

@@ -1625,6 +1631,61 @@ function failedDynamicToolResponse(message: string): CodexDynamicToolCallRespons

16251631

};

16261632

}

162716331634+

function resolveDynamicToolCallTimeoutMs(params: {

1635+

call: CodexDynamicToolCallParams;

1636+

config: EmbeddedRunAttemptParams["config"];

1637+

}): number {

1638+

return clampDynamicToolTimeoutMs(

1639+

readDynamicToolCallTimeoutMs(params.call.arguments) ??

1640+

readConfiguredDynamicToolTimeoutMs(params.call.tool, params.config) ??

1641+

CODEX_DYNAMIC_TOOL_TIMEOUT_MS,

1642+

);

1643+

}

1644+1645+

function readDynamicToolCallTimeoutMs(value: JsonValue | undefined): number | undefined {

1646+

if (!isJsonObject(value)) {

1647+

return undefined;

1648+

}

1649+

return readPositiveFiniteTimeoutMs(value.timeoutMs);

1650+

}

1651+1652+

function readConfiguredDynamicToolTimeoutMs(

1653+

toolName: string,

1654+

config: EmbeddedRunAttemptParams["config"],

1655+

): number | undefined {

1656+

if (toolName === "image_generate") {

1657+

const imageGenerationModel = config?.agents?.defaults?.imageGenerationModel;

1658+

if (!imageGenerationModel || typeof imageGenerationModel !== "object") {

1659+

return undefined;

1660+

}

1661+

return readPositiveFiniteTimeoutMs(imageGenerationModel.timeoutMs);

1662+

}

1663+1664+

if (toolName === "image") {

1665+

return (

1666+

readTimeoutSecondsAsMs(config?.tools?.media?.image?.timeoutSeconds) ??

1667+

CODEX_DYNAMIC_IMAGE_TOOL_TIMEOUT_MS

1668+

);

1669+

}

1670+1671+

return undefined;

1672+

}

1673+1674+

function readTimeoutSecondsAsMs(value: unknown): number | undefined {

1675+

const seconds = readPositiveFiniteTimeoutMs(value);

1676+

return seconds === undefined ? undefined : seconds * 1000;

1677+

}

1678+1679+

function readPositiveFiniteTimeoutMs(value: unknown): number | undefined {

1680+

return typeof value === "number" && Number.isFinite(value) && value > 0

1681+

? Math.floor(value)

1682+

: undefined;

1683+

}

1684+1685+

function clampDynamicToolTimeoutMs(timeoutMs: number): number {

1686+

return Math.max(1, Math.min(CODEX_DYNAMIC_TOOL_MAX_TIMEOUT_MS, Math.floor(timeoutMs)));

1687+

}

1688+16281689

function createCodexNativeHookRelay(params: {

16291690

options:

16301691

| {

@@ -2292,6 +2353,8 @@ function handleApprovalRequest(params: {

2292235322932354

export const __testing = {

22942355

CODEX_DYNAMIC_TOOL_TIMEOUT_MS,

2356+

CODEX_DYNAMIC_TOOL_MAX_TIMEOUT_MS,

2357+

CODEX_DYNAMIC_IMAGE_TOOL_TIMEOUT_MS,

22952358

CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS,

22962359

CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS,

22972360

buildCodexNativeHookRelayId,

@@ -2300,6 +2363,7 @@ export const __testing = {

23002363

filterCodexDynamicToolsForAllowlist,

23012364

filterToolsForVisionInputs,

23022365

handleDynamicToolCallWithTimeout,

2366+

resolveDynamicToolCallTimeoutMs,

23032367

resolveCodexPluginAppCacheEndpoint,

23042368

resolveOpenClawCodingToolsSessionKeys,

23052369

shouldForceMessageTool,