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

推荐订阅源

腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
I
InfoQ
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
G
Google Developers Blog
L
LangChain Blog
博客园_首页
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
IT之家
IT之家
量子位
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网

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): recover app-server completion stalls · opencl...
keshavbotage · 2026-05-30 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -808,12 +808,15 @@ describe("connectCodexAppServerEndpoint", () => {

808808

const sawProbeRequest = new Promise<void>((resolve) => {

809809

server.once("connection", (socket) => {

810810

socket.on("message", (data) => {

811-

const text = Array.isArray(data)

812-

? Buffer.concat(data).toString("utf8")

813-

: data instanceof ArrayBuffer

814-

? Buffer.from(new Uint8Array(data)).toString("utf8")

815-

: Buffer.from(data).toString("utf8");

816-

const request = JSON.parse(text) as Record<string, unknown>;

811+

const messageText =

812+

typeof data === "string"

813+

? data

814+

: Array.isArray(data)

815+

? Buffer.concat(data).toString()

816+

: data instanceof ArrayBuffer

817+

? Buffer.from(new Uint8Array(data)).toString()

818+

: Buffer.from(data).toString();

819+

const request = JSON.parse(messageText) as Record<string, unknown>;

817820

if (request.method === "initialize") {

818821

socket.send(JSON.stringify({ id: request.id, result: {} }));

819822

}

Original file line numberDiff line numberDiff line change

@@ -176,7 +176,8 @@

176176

},

177177

"postToolRawAssistantCompletionIdleTimeoutMs": {

178178

"type": "number",

179-

"minimum": 1

179+

"minimum": 1,

180+

"default": 300000

180181

},

181182

"approvalPolicy": {

182183

"type": "string",

@@ -360,7 +361,7 @@

360361

},

361362

"appServer.postToolRawAssistantCompletionIdleTimeoutMs": {

362363

"label": "Post-Tool Raw Assistant Completion Idle Timeout",

363-

"help": "Completion-idle guard after a tool handoff when Codex emits raw assistant completion or progress without turn/completed. Defaults to the assistant completion idle timeout when unset.",

364+

"help": "Completion-idle guard after a tool handoff when Codex emits raw assistant completion or progress without turn/completed. Defaults to 300000 ms when unset.",

364365

"advanced": true

365366

},

366367

"appServer.approvalPolicy": {

Original file line numberDiff line numberDiff line change

@@ -4,6 +4,7 @@ import {

44

isAssistantCompletionReleaseNotification,

55

isCodexTurnAbortMarkerNotification,

66

isNativeToolProgressNotification,

7+

isNativeResponseStreamDeltaNotification,

78

isPendingOpenClawDynamicToolCompletionNotification,

89

isRawAssistantCompletionNotification,

910

isRawReasoningCompletionNotification,

@@ -99,9 +100,10 @@ export function applyCodexTurnNotificationState(params: {

99100

params.turnId,

100101

);

101102

const isTurnCompletion = notification.method === "turn/completed" && isCurrentTurnNotification;

103+

const isNativeResponseStreamDelta = isNativeResponseStreamDeltaNotification(notification);

102104

let turnCrossedToolHandoff = params.turnCrossedToolHandoff;

103105
104-

if (isCurrentTurnNotification) {

106+

if (isCurrentTurnNotification && !isNativeResponseStreamDelta) {

105107

turnWatches.touchActivity(`notification:${notification.method}`, {

106108

details: describeNotificationActivity(notification),

107109

attemptProgress: true,

@@ -174,6 +176,9 @@ export function applyCodexTurnNotificationState(params: {

174176

} else if (isCurrentTurnNotification && assistantCompletionCanRelease) {

175177

turnWatches.armAssistantCompletionIdleWatch(describeNotificationActivity(notification));

176178

} else if (postToolRawAssistantCompletionNeedsTerminalGuard) {

179+

// A post-tool assistant status can be followed by native Codex streaming a

180+

// large custom tool input. Forwarded raw deltas refresh activity at enqueue

181+

// time; keep this guard conservative for versions that do not forward them.

177182

turnWatches.armCompletionIdleWatch({

178183

timeoutMs: params.postToolRawAssistantCompletionIdleTimeoutMs,

179184

});

@@ -203,6 +208,7 @@ export function applyCodexTurnNotificationState(params: {

203208

!turnWatches.isCompletionIdleWatchPinnedByTerminalError() &&

204209

notification.method !== "turn/completed" &&

205210

isCurrentTurnNotification &&

211+

!isNativeResponseStreamDelta &&

206212

!trackedDynamicToolCompletion &&

207213

!rawToolOutputCompletion &&

208214

!postToolRawAssistantCompletionNeedsTerminalGuard &&

Original file line numberDiff line numberDiff line change

@@ -179,6 +179,12 @@ export function isNativeToolProgressNotification(notification: CodexServerNotifi

179179

}

180180

}

181181
182+

export function isNativeResponseStreamDeltaNotification(

183+

notification: CodexServerNotification,

184+

): boolean {

185+

return notification.method.startsWith("response.") && notification.method.endsWith(".delta");

186+

}

187+
182188

export function isRawAssistantCompletionNotification(

183189

notification: CodexServerNotification,

184190

): boolean {

Original file line numberDiff line numberDiff line change

@@ -89,6 +89,28 @@ describe("Codex app-server attempt results", () => {

8989

replayInvalid: true,

9090

livenessState: "abandoned",

9191

});

92+

expect(

93+

buildCodexAppServerPromptTimeoutOutcome({

94+

result: createResult({

95+

assistantTexts: ["I am changing the data model now..."],

96+

}),

97+

turnCompletionIdleTimedOut: true,

98+

}),

99+

).toEqual({

100+

message:

101+

"Codex stopped before confirming the turn was complete. The response may be incomplete; retry if needed.",

102+

});

103+

expect(

104+

buildCodexAppServerPromptTimeoutOutcome({

105+

result: createResult({

106+

toolMetas: [{ toolName: "exec" }],

107+

}),

108+

turnCompletionIdleTimedOut: true,

109+

}),

110+

).toEqual({

111+

message:

112+

"Codex stopped before confirming the turn was complete. The response may be incomplete; retry if needed.",

113+

});

92114

});

93115
94116

it("classifies replay blocked reasons", () => {

Original file line numberDiff line numberDiff line change

@@ -27,10 +27,12 @@ export function buildCodexAppServerPromptTimeoutOutcome(params: {

2727

const completionIdleTimeoutHadPotentialSideEffects = hasCodexAppServerPotentialSideEffectEvidence(

2828

params.result,

2929

);

30+

const replayBlockedReason = resolveCodexAppServerReplayBlockedReason(params.result);

3031

if (

3132

!params.turnCompletionIdleTimedOut ||

3233

(params.result.itemLifecycle.completedCount === 0 &&

33-

!completionIdleTimeoutHadPotentialSideEffects)

34+

!completionIdleTimeoutHadPotentialSideEffects &&

35+

replayBlockedReason === undefined)

3436

) {

3537

return undefined;

3638

}

Original file line numberDiff line numberDiff line change

@@ -1,6 +1,7 @@

11

import { afterEach, describe, expect, it, vi } from "vitest";

22

import {

33

CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS,

4+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

45

CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

56

CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS,

67

CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS,

@@ -36,6 +37,11 @@ describe("Codex app-server attempt timeouts", () => {

3637

});

3738
3839

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

40+

expect(CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS).toBe(5 * 60_000);

41+

expect(CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS).toBeGreaterThan(

42+

CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS,

43+

);

44+
3945

expect(resolveCodexTurnCompletionIdleTimeoutMs(undefined)).toBe(

4046

CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS,

4147

);

@@ -54,9 +60,21 @@ describe("Codex app-server attempt timeouts", () => {

5460

expect(resolveCodexTurnAssistantCompletionIdleTimeoutMs(9.8)).toBe(9);

5561

expect(resolveCodexTurnAssistantCompletionIdleTimeoutMs(-10)).toBe(1);

5662
57-

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

58-

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

59-

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

63+

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

64+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

65+

);

66+

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

67+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

68+

);

69+

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(undefined, 120_000)).toBe(

70+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

71+

);

72+

expect(resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(undefined, 6 * 60_000)).toBe(

73+

6 * 60_000,

74+

);

75+

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

76+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

77+

);

6078

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

6179

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

6280
Original file line numberDiff line numberDiff line change

@@ -3,6 +3,10 @@ import { parseFiniteNumber } from "openclaw/plugin-sdk/number-runtime";

33

export const CODEX_APP_SERVER_STARTUP_TIMEOUT_FLOOR_MS = 100;

44

export const CODEX_TURN_COMPLETION_IDLE_TIMEOUT_MS = 60_000;

55

export const CODEX_TURN_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 10_000;

6+

// Native Codex can stream a large custom tool input after a raw assistant

7+

// progress item. Forwarded deltas count as activity, but older native paths may

8+

// not surface them, so keep this terminal guard conservative.

9+

export const CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS = 5 * 60_000;

610

export const CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS = 5 * 60_000;

711

export const CODEX_TURN_TERMINAL_IDLE_TIMEOUT_MS = 30 * 60_000;

812

@@ -91,7 +95,11 @@ export function resolveCodexPostToolRawAssistantCompletionIdleTimeoutMs(

9195

value: number | undefined,

9296

fallbackMs: number,

9397

): number {

94-

return resolvePositiveIntegerTimeoutMs(value, fallbackMs);

98+

const defaultMs = Math.max(

99+

resolvePositiveIntegerTimeoutMs(undefined, fallbackMs),

100+

CODEX_POST_TOOL_RAW_ASSISTANT_COMPLETION_IDLE_TIMEOUT_MS,

101+

);

102+

return resolvePositiveIntegerTimeoutMs(value, defaultMs);

95103

}

96104
97105

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