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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
WordPress大学
WordPress大学
U
Unit 42
I
InfoQ
A
About on SuperTechFans
宝玉的分享
宝玉的分享
J
Java Code Geeks
博客园 - 司徒正美
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
腾讯CDC
Recent Announcements
Recent Announcements

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(codex): default non-finite app-server timeouts · open...
steipete · 2026-05-29 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -23,6 +23,16 @@ describe("Codex app-server attempt timeouts", () => {

2323

);

2424

expect(resolveCodexStartupTimeoutMs({ timeoutMs: 500 })).toBe(500);

2525

expect(resolveCodexStartupTimeoutMs({ timeoutMs: 5, timeoutFloorMs: 250 })).toBe(250);

26+

expect(resolveCodexStartupTimeoutMs({ timeoutMs: Number.NaN })).toBe(

27+

CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS,

28+

);

29+

expect(resolveCodexStartupTimeoutMs({ timeoutMs: 500, timeoutFloorMs: Number.NaN })).toBe(500);

30+

expect(

31+

resolveCodexStartupTimeoutMs({

32+

timeoutMs: Number.NaN,

33+

timeoutFloorMs: Number.NaN,

34+

}),

35+

).toBe(CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS);

2636

});

2737
2838

it("normalizes turn idle timeout overrides", () => {

@@ -46,6 +56,7 @@ describe("Codex app-server attempt timeouts", () => {

4656
4757

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(undefined, 123)).toBe(123);

4858

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(Number.NaN, 123)).toBe(123);

59+

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(undefined, Number.NaN)).toBe(1);

4960

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(7.9, 123)).toBe(7);

5061

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(0, 123)).toBe(1);

5162
Original file line numberDiff line numberDiff line change

@@ -1,9 +1,17 @@

1+

import { parseFiniteNumber } from "openclaw/plugin-sdk/number-runtime";

2+
13

export const CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS = 100;

24

export const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 60_000;

35

export const CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 10_000;

46

export const CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS = 5 * 60_000;

57

export const CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS = 30 * 60_000;

68
9+

function resolvePositiveIntegerTimeoutMs(value: number | undefined, fallbackMs: number): number {

10+

const fallback = parseFiniteNumber(fallbackMs) ?? 1;

11+

const candidate = parseFiniteNumber(value) ?? fallback;

12+

return Math.max(1, Math.floor(candidate));

13+

}

14+
715

export async function withCodexStartupTimeout<T>(params: {

816

timeoutMs: number;

917

signal: AbortSignal;

@@ -61,53 +69,31 @@ export function resolveCodexStartupTimeoutMs(params: {

6169

timeoutMs: number;

6270

timeoutFloorMs?: number;

6371

}): number {

64-

return Math.max(

65-

params.timeoutFloorMs ?? CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS,

66-

params.timeoutMs,

72+

const timeoutFloorMs = resolvePositiveIntegerTimeoutMs(

73+

params.timeoutFloorMs,

74+

CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS,

6775

);

76+

const timeoutMs = resolvePositiveIntegerTimeoutMs(params.timeoutMs, timeoutFloorMs);

77+

return Math.max(timeoutFloorMs, timeoutMs);

6878

}

6979
7080

export function resolveCodexTurnCompletionIdleTimeoutMs(value: number | undefined): number {

71-

if (value === undefined) {

72-

return CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS;

73-

}

74-

if (!Number.isFinite(value)) {

75-

return CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS;

76-

}

77-

return Math.max(1, Math.floor(value));

81+

return resolvePositiveIntegerTimeoutMs(value, CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS);

7882

}

7983
8084

export function resolveCodexTurnAssistantCompletionIdleTimeoutMs(

8185

value: number | undefined,

8286

): number {

83-

if (value === undefined) {

84-

return CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS;

85-

}

86-

if (!Number.isFinite(value)) {

87-

return CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS;

88-

}

89-

return Math.max(1, Math.floor(value));

87+

return resolvePositiveIntegerTimeoutMs(value, CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS);

9088

}

9189
9290

export function resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(

9391

value: number | undefined,

9492

fallbackMs: number,

9593

): number {

96-

if (value === undefined) {

97-

return fallbackMs;

98-

}

99-

if (!Number.isFinite(value)) {

100-

return fallbackMs;

101-

}

102-

return Math.max(1, Math.floor(value));

94+

return resolvePositiveIntegerTimeoutMs(value, fallbackMs);

10395

}

10496
10597

export function resolveCodexTurnTerminalIdleTimeoutMs(value: number | undefined): number {

106-

if (value === undefined) {

107-

return CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS;

108-

}

109-

if (!Number.isFinite(value)) {

110-

return CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS;

111-

}

112-

return Math.max(1, Math.floor(value));

98+

return resolvePositiveIntegerTimeoutMs(value, CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS);

11399

}