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

推荐订阅源

J
Java Code Geeks
Martin Fowler
Martin Fowler
B
Blog RSS Feed
D
DataBreaches.Net
L
LangChain Blog
月光博客
月光博客
S
SegmentFault 最新的问题
阮一峰的网络日志
阮一峰的网络日志
V
Visual Studio Blog
美团技术团队
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
小众软件
小众软件
罗磊的独立博客
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta

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: harden agent recovery failures (#79729) · openclaw/o...
stainlu · 2026-05-09 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -167,6 +167,7 @@ Docs: https://docs.openclaw.ai

167167

- OpenAI/Codex: install the Codex runtime plugin from npm during OpenAI onboarding and load it automatically for implicit OpenAI model routes, while preserving manual PI runtime overrides. Fixes #79358.

168168

- OpenAI/realtime voice: defer `response.create` while a realtime response is still active, retry after `response.done`/`response.cancelled`, and align GA input transcription/noise-reduction defaults with the Codex realtime reference so Discord/Voice Call consult results can resume speaking instead of tripping the active-response race.

169169

- OpenAI/realtime voice: avoid duplicate barge-in cancellation requests, log realtime model interruption/cutoff events in Discord voice logs, and treat OpenAI's no-active-response cancellation reply as a completed cancel so Discord voice sessions do not wedge pending speech after fast interruptions.

170+

- Agents/runtime: strip trailing assistant prefill for Claude-family OpenAI Responses routes, persist prompt/assistant profile cooldown marks before fallback, and show the configured container root in sandbox escape diagnostics. Fixes #79688 and #79712. Thanks @stainlu and @mushuiyu886.

170171

- Gateway: avoid false degraded event-loop health during rapid health/readiness/status probes unless sustained load has delay co-evidence, while keeping hard delay detection immediate. (#77028) Thanks @rubencu.

171172

- Markdown: keep blockquote spans off trailing paragraph separators. Fixes #79646.

172173

- Plugin SDK/LM Studio: recover Harmony plain-text tool calls from LM Studio streams. Fixes #78326.

Original file line numberDiff line numberDiff line change

@@ -2042,13 +2042,15 @@ export async function runEmbeddedPiAgent(

20422042

(await advanceAuthProfile())

20432043

) {

20442044

if (failedPromptProfileId && promptProfileFailureReason) {

2045-

maybeMarkAuthProfileFailure({

2046-

profileId: failedPromptProfileId,

2047-

reason: promptProfileFailureReason,

2048-

modelId,

2049-

}).catch((err) =>

2050-

log.warn(`deferred prompt profile failure mark failed: ${String(err)}`),

2051-

);

2045+

try {

2046+

await maybeMarkAuthProfileFailure({

2047+

profileId: failedPromptProfileId,

2048+

reason: promptProfileFailureReason,

2049+

modelId,

2050+

});

2051+

} catch (err) {

2052+

log.warn(`prompt profile failure mark failed: ${String(err)}`);

2053+

}

20522054

}

20532055

traceAttempts.push({

20542056

provider,

@@ -2077,13 +2079,15 @@ export async function runEmbeddedPiAgent(

20772079

});

20782080

}

20792081

if (failedPromptProfileId && promptProfileFailureReason) {

2080-

maybeMarkAuthProfileFailure({

2081-

profileId: failedPromptProfileId,

2082-

reason: promptProfileFailureReason,

2083-

modelId,

2084-

}).catch((err) =>

2085-

log.warn(`deferred prompt profile failure mark failed: ${String(err)}`),

2086-

);

2082+

try {

2083+

await maybeMarkAuthProfileFailure({

2084+

profileId: failedPromptProfileId,

2085+

reason: promptProfileFailureReason,

2086+

modelId,

2087+

});

2088+

} catch (err) {

2089+

log.warn(`prompt profile failure mark failed: ${String(err)}`);

2090+

}

20872091

}

20882092

const fallbackThinking = pickFallbackThinkingLevel({

20892093

message: errorText,

Original file line numberDiff line numberDiff line change

@@ -153,7 +153,7 @@ export async function handleAssistantFailover(params: {

153153

}

154154
155155

const rotated = await params.advanceAuthProfile();

156-

void markFailedProfile();

156+

await markFailedProfile();

157157

if (params.timedOut && !params.isProbeSession && failedProfileId) {

158158

params.warn(`Profile ${failedProfileId} timed out. Trying next account...`);

159159

}

Original file line numberDiff line numberDiff line change

@@ -81,6 +81,7 @@ describe("resolveAttemptTranscriptPolicy", () => {

8181

sanitizeToolCallIds: true,

8282

toolCallIdMode: "strict",

8383

repairToolUseResultPairing: true,

84+

validateAnthropicTurns: false,

8485

allowSyntheticToolResults: false,

8586

});

8687

expect(resolveProviderRuntimePluginMock).toHaveBeenCalledWith({

@@ -90,4 +91,22 @@ describe("resolveAttemptTranscriptPolicy", () => {

9091

env,

9192

});

9293

});

94+
95+

it("inherits Claude-family OpenAI Responses turn validation from legacy fallback", () => {

96+

const policy = resolveAttemptTranscriptPolicy({

97+

runtimePlanModelContext: {

98+

workspaceDir: "/tmp/openclaw-transcript-policy",

99+

modelApi: "openai-responses",

100+

},

101+

provider: "anthropic-foundry",

102+

modelId: "anthropic-foundry/claude-opus-4-7",

103+

});

104+
105+

expect(policy).toMatchObject({

106+

sanitizeToolCallIds: true,

107+

toolCallIdMode: "strict",

108+

validateAnthropicTurns: true,

109+

validateGeminiTurns: false,

110+

});

111+

});

93112

});

Original file line numberDiff line numberDiff line change

@@ -89,7 +89,7 @@ describe("resolveSandboxFsPathWithMounts", () => {

8989

expect(resolved.writable).toBe(true);

9090

});

9191
92-

it("preserves legacy sandbox-root error for outside paths", () => {

92+

it("includes the container workspace root in outside-path errors", () => {

9393

const sandbox = createSandbox();

9494

const mounts = buildSandboxFsMounts(sandbox);

9595

expect(() =>

@@ -100,7 +100,31 @@ describe("resolveSandboxFsPathWithMounts", () => {

100100

defaultContainerRoot: sandbox.containerWorkdir,

101101

mounts,

102102

}),

103-

).toThrow(/Path escapes sandbox root/);

103+

).toThrow(

104+

/Path escapes sandbox root \(.*container root \/workspace\): \/etc\/passwd\. Use a path under \/workspace\/ instead\./,

105+

);

106+

});

107+
108+

it("uses the configured custom container root in outside-path errors", () => {

109+

const sandbox = createSandbox({

110+

containerWorkdir: "/sandbox-root",

111+

docker: {

112+

...createSandbox().docker,

113+

workdir: "/sandbox-root",

114+

},

115+

});

116+

const mounts = buildSandboxFsMounts(sandbox);

117+

expect(() =>

118+

resolveSandboxFsPathWithMounts({

119+

filePath: "/tmp/healthcheck-alert/config.json",

120+

cwd: sandbox.workspaceDir,

121+

defaultWorkspaceRoot: sandbox.workspaceDir,

122+

defaultContainerRoot: sandbox.containerWorkdir,

123+

mounts,

124+

}),

125+

).toThrow(

126+

/Path escapes sandbox root \(.*container root \/sandbox-root\): \/tmp\/healthcheck-alert\/config\.json\. Use a path under \/sandbox-root\/ instead\./,

127+

);

104128

});

105129
106130

it("prefers custom bind mounts over default workspace mount at /workspace", () => {

Original file line numberDiff line numberDiff line change

@@ -151,13 +151,30 @@ export function resolveSandboxFsPathWithMounts(params: {

151151

};

152152

}

153153
154-

// Preserve legacy error wording for out-of-sandbox paths.

155-

resolveSandboxPath({

156-

filePath: input,

157-

cwd: params.cwd,

158-

root: params.defaultWorkspaceRoot,

154+

const escapeMessage = formatSandboxRootEscapeMessage({

155+

input,

156+

defaultWorkspaceRoot: params.defaultWorkspaceRoot,

157+

defaultContainerRoot: params.defaultContainerRoot,

159158

});

160-

throw new Error(`Path escapes sandbox root (${params.defaultWorkspaceRoot}): ${input}`);

159+

try {

160+

resolveSandboxPath({

161+

filePath: input,

162+

cwd: params.cwd,

163+

root: params.defaultWorkspaceRoot,

164+

});

165+

} catch {

166+

throw new Error(escapeMessage);

167+

}

168+

throw new Error(escapeMessage);

169+

}

170+
171+

function formatSandboxRootEscapeMessage(params: {

172+

input: string;

173+

defaultWorkspaceRoot: string;

174+

defaultContainerRoot: string;

175+

}): string {

176+

const containerRoot = normalizeContainerPath(params.defaultContainerRoot);

177+

return `Path escapes sandbox root (${params.defaultWorkspaceRoot}; container root ${containerRoot}): ${params.input}. Use a path under ${containerRoot}/ instead.`;

161178

}

162179
163180

function compareMountsByContainerPath(a: SandboxFsMount, b: SandboxFsMount): number {

Original file line numberDiff line numberDiff line change

@@ -366,6 +366,25 @@ describe("resolveTranscriptPolicy", () => {

366366

expectStrictOpenAiCompatibleReplayDefaults("custom-openai-proxy");

367367

});

368368
369+

it("enables assistant prefill stripping for unowned Claude OpenAI Responses routes (#79688)", () => {

370+

const claudePolicy = resolveTranscriptPolicy({

371+

provider: "anthropic-foundry",

372+

modelId: "anthropic-foundry/claude-opus-4-7",

373+

modelApi: "openai-responses",

374+

});

375+

expect(claudePolicy.sanitizeToolCallIds).toBe(true);

376+

expect(claudePolicy.toolCallIdMode).toBe("strict");

377+

expect(claudePolicy.validateAnthropicTurns).toBe(true);

378+

expect(claudePolicy.validateGeminiTurns).toBe(false);

379+
380+

const gptPolicy = resolveTranscriptPolicy({

381+

provider: "custom-openai-proxy",

382+

modelId: "gpt-5.4",

383+

modelApi: "openai-responses",

384+

});

385+

expect(gptPolicy.validateAnthropicTurns).toBe(false);

386+

});

387+
369388

it("preserves thinking blocks for newer Claude models in unowned Anthropic transport fallback", () => {

370389

// Opus 4.6 via custom proxy: should NOT drop thinking blocks

371390

const opus46 = resolveTranscriptPolicy({

Original file line numberDiff line numberDiff line change

@@ -71,6 +71,19 @@ function isAnthropicApi(modelApi?: string | null): boolean {

7171

return modelApi === "anthropic-messages" || modelApi === "bedrock-converse-stream";

7272

}

7373
74+

function isOpenAiResponsesCompatibleApi(modelApi?: string | null): boolean {

75+

return (

76+

modelApi === "openai-responses" ||

77+

modelApi === "openai-codex-responses" ||

78+

modelApi === "azure-openai-responses"

79+

);

80+

}

81+
82+

function isClaudeFamilyModelId(modelId?: string | null): boolean {

83+

const id = normalizeLowercaseStringOrEmpty(modelId);

84+

return /(?:^|[./:_-])claude(?:$|[./:_-])/.test(id);

85+

}

86+
7487

/**

7588

* Provides a narrow replay-policy fallback for providers that do not have an

7689

* owning runtime plugin.

@@ -101,6 +114,9 @@ function buildUnownedProviderTransportReplayFallback(params: {

101114

}

102115
103116

const modelId = normalizeLowercaseStringOrEmpty(params.modelId);

117+

const isClaudeOpenAiResponses = isOpenAiResponsesCompatibleApi(params.modelApi)

118+

? isClaudeFamilyModelId(modelId)

119+

: false;

104120

return {

105121

...(isGoogle || isAnthropic ? { sanitizeMode: "full" as const } : {}),

106122

...(isGoogle || isAnthropic || requiresOpenAiCompatibleToolIdSanitization

@@ -126,7 +142,9 @@ function buildUnownedProviderTransportReplayFallback(params: {

126142

: {}),

127143

...(isGoogle || isStrictOpenAiCompatible ? { applyAssistantFirstOrderingFix: true } : {}),

128144

...(isGoogle || isStrictOpenAiCompatible ? { validateGeminiTurns: true } : {}),

129-

...(isAnthropic || isStrictOpenAiCompatible ? { validateAnthropicTurns: true } : {}),

145+

...(isAnthropic || isStrictOpenAiCompatible || isClaudeOpenAiResponses

146+

? { validateAnthropicTurns: true }

147+

: {}),

130148

...(isGoogle || isAnthropic ? { allowSyntheticToolResults: true } : {}),

131149

};

132150

}