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

推荐订阅源

S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
博客园 - 【当耐特】
月光博客
月光博客
Vercel News
Vercel News
D
Docker
I
InfoQ
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
有赞技术团队
有赞技术团队
雷峰网
雷峰网
博客园 - 聂微东
小众软件
小众软件
Y
Y Combinator Blog
腾讯CDC
L
LangChain Blog
The GitHub Blog
The GitHub Blog
宝玉的分享
宝玉的分享
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss

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): keep app-server continuation turns alive · op...
abnershang · 2026-05-31 · via Recent Commits to openclaw:main

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

44

isAssistantCompletionReleaseNotification,

55

isCodexTurnAbortMarkerNotification,

66

isFileChangePatchUpdatedNotification,

7+

isAssistantCommentaryCompletionNotification,

78

isNativeToolProgressNotification,

89

isNativeResponseStreamDeltaNotification,

910

isPendingOpenClawDynamicToolCompletionNotification,

@@ -18,7 +19,7 @@ import {

1819

shouldDisarmAssistantCompletionIdleWatch,

1920

updateActiveTurnItemIds,

2021

} from "./attempt-notifications.js";

21-

import { CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS } from "./attempt-timeouts.js";

22+

import { CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS } from "./attempt-timeouts.js";

2223

import type { CodexAttemptTurnWatchController } from "./attempt-turn-watches.js";

2324

import type { CodexServerNotification } from "./protocol.js";

2425

@@ -79,7 +80,6 @@ export function applyCodexTurnNotificationState(params: {

7980

threadId: string;

8081

turnId: string;

8182

currentPromptTexts: string[];

82-

sourceReplyDeliveryMode: string | undefined;

8383

turnWatches: CodexAttemptTurnWatchController;

8484

activeTurnItemIds: Set<string>;

8585

activeAppServerTurnRequests: number;

@@ -151,23 +151,45 @@ export function applyCodexTurnNotificationState(params: {

151151

params.activeTurnItemIds.size === 0 &&

152152

params.activeAppServerTurnRequests === 0 &&

153153

!assistantCompletionCanRelease &&

154-

!postToolRawAssistantCompletionNeedsTerminalGuard;

155-

const shouldArmPostReasoningSourceReplyWatch =

154+

!postToolRawAssistantCompletionNeedsTerminalGuard &&

155+

!rawToolOutputCompletion;

156+

const shouldArmNoToolPostProgressReplyWatch =

156157

isCurrentTurnNotification &&

157-

isReasoningItemCompletionNotification(notification) &&

158+

!turnCrossedToolHandoff &&

158159

params.activeTurnItemIds.size === 0 &&

159-

params.sourceReplyDeliveryMode === "message_tool_only";

160-

const shouldArmPostRawReasoningSourceReplyWatch =

160+

(isReasoningItemCompletionNotification(notification) ||

161+

isAssistantCommentaryCompletionNotification(notification));

162+

const shouldArmNoToolPostRawProgressReplyWatch =

163+

!turnCrossedToolHandoff &&

161164

rawResponseItemCompletedWithNoActiveItems &&

162-

isRawReasoningCompletionNotification(notification) &&

163-

params.sourceReplyDeliveryMode === "message_tool_only";

165+

(isRawReasoningCompletionNotification(notification) ||

166+

isRawAssistantProgressNotification(notification));

164167

const shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem =

165168

isCurrentTurnNotification &&

166169

notification.method === "item/completed" &&

167170

params.activeTurnItemIds.size === 0 &&

168171

!trackedDynamicToolCompletion &&

169172

!assistantCompletionCanRelease &&

170-

!shouldArmPostReasoningSourceReplyWatch;

173+

!shouldArmNoToolPostProgressReplyWatch;

174+

const shouldUsePostToolContinuationWatch =

175+

turnCrossedToolHandoff &&

176+

(postToolRawAssistantCompletionNeedsTerminalGuard ||

177+

postToolPatchUpdateNeedsTerminalGuard ||

178+

rawToolOutputCompletion ||

179+

trackedDynamicToolCompletion ||

180+

shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem);

181+

const armPostToolContinuationWatch = () => {

182+

turnWatches.armCompletionIdleWatch({

183+

timeoutMs: params.postToolRawAssistantCompletionIdleTimeoutMs,

184+

});

185+

turnWatches.extendAttemptIdleWatch(params.postToolRawAssistantCompletionIdleTimeoutMs);

186+

};

187+

const armPostProgressReplyWatch = () => {

188+

turnWatches.armCompletionIdleWatch({

189+

timeoutMs: CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS,

190+

});

191+

turnWatches.extendAttemptIdleWatch(CODEX_POST_REASONING_REPLY_IDLE_TIMEOUT_MS);

192+

};

171193172194

if (isCurrentTurnNotification && notification.method === "error") {

173195

if (isRetryableErrorNotification(notification.params)) {

@@ -187,26 +209,28 @@ export function applyCodexTurnNotificationState(params: {

187209

// Post-tool assistant status and patch snapshots can be followed by more

188210

// native edit streaming. Keep the short guard alive until Codex reports a

189211

// terminal turn state instead of falling back to the long terminal watch.

190-

turnWatches.armCompletionIdleWatch({

191-

timeoutMs: params.postToolRawAssistantCompletionIdleTimeoutMs,

192-

});

193-

} else if (shouldArmPostReasoningSourceReplyWatch || shouldArmPostRawReasoningSourceReplyWatch) {

194-

turnWatches.armCompletionIdleWatch({

195-

timeoutMs: CODEX_POST_REASONING_SOURCE_REPLY_IDLE_TIMEOUT_MS,

196-

});

212+

armPostToolContinuationWatch();

213+

} else if (shouldArmNoToolPostProgressReplyWatch || shouldArmNoToolPostRawProgressReplyWatch) {

214+

armPostProgressReplyWatch();

215+

} else if (trackedDynamicToolCompletion) {

216+

armPostToolContinuationWatch();

197217

} else if (unblockedAssistantCompletionRelease) {

198218

turnWatches.armAssistantCompletionIdleWatch(describeNotificationActivity(notification));

199219

} else if (shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem) {

200220

// If a non-assistant current-turn item is the last active item and the

201221

// bridge then goes quiet, reset the short completion-idle guard from that

202222

// final completion so the remaining silent-turn gap fails fast.

203-

turnWatches.armCompletionIdleWatch();

223+

if (shouldUsePostToolContinuationWatch) {

224+

armPostToolContinuationWatch();

225+

} else {

226+

turnWatches.armCompletionIdleWatch();

227+

}

204228

} else if (rawResponseItemCompletedWithNoActiveItems) {

205229

turnWatches.armCompletionIdleWatch();

206230

} else if (isCurrentTurnNotification && rawToolOutputCompletion) {

207231

// Raw OpenAI response streams can report the tool-output handoff without

208232

// a matching app-server `item/completed`; keep the post-tool guard alive.

209-

turnWatches.armCompletionIdleWatch();

233+

armPostToolContinuationWatch();

210234

} else if (isCurrentTurnNotification && shouldDisarmAssistantCompletionIdleWatch(notification)) {

211235

turnWatches.disarmAssistantCompletionIdleWatch();

212236

}

@@ -222,8 +246,8 @@ export function applyCodexTurnNotificationState(params: {

222246

!postToolRawAssistantCompletionNeedsTerminalGuard &&

223247

!postToolPatchUpdateNeedsTerminalGuard &&

224248

!rawResponseItemCompletedWithNoActiveItems &&

225-

!shouldArmPostReasoningSourceReplyWatch &&

226-

!shouldArmPostRawReasoningSourceReplyWatch &&

249+

!shouldArmNoToolPostProgressReplyWatch &&

250+

!shouldArmNoToolPostRawProgressReplyWatch &&

227251

!shouldRearmCompletionIdleWatchAfterLastCurrentTurnItem

228252

) {

229253

// The short completion-idle watchdog guards blind gaps after Codex