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

推荐订阅源

Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
小众软件
小众软件
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
博客园_首页
T
Tailwind CSS Blog
The Cloudflare Blog
J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
P
Proofpoint News Feed
aimingoo的专栏
aimingoo的专栏
Recent Announcements
Recent Announcements
T
The Blog of Author Tim Ferriss
D
Docker
Microsoft Azure Blog
Microsoft Azure Blog

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(agents): retry thinking-only errored turns (#92191) ·...
ai-hpc · 2026-06-15 · via Recent Commits to openclaw:main

@@ -149,6 +149,7 @@ const TINY_PNG_BASE64 =

149149

"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO7Z0nQAAAAASUVORK5CYII=";

150150

const QA_REASONING_ONLY_RECOVERY_PROMPT_RE = /reasoning-only continuation qa check/i;

151151

const QA_REASONING_ONLY_SIDE_EFFECT_PROMPT_RE = /reasoning-only after write safety check/i;

152+

const QA_ANTHROPIC_THINKING_ERROR_RECOVERY_PROMPT_RE = /anthropic thinking error qa check/i;

152153

const QA_THINKING_VISIBILITY_OFF_PROMPT_RE = /qa thinking visibility check off/i;

153154

const QA_THINKING_VISIBILITY_MAX_PROMPT_RE = /qa thinking visibility check max/i;

154155

const QA_EMPTY_RESPONSE_RECOVERY_PROMPT_RE = /empty response continuation qa check/i;

@@ -189,6 +190,7 @@ const QA_GROUP_AUDIO_MIN_MULTIPART_BODY_CHARS = 48_000;

189190

const QA_MCP_CODE_MODE_API_FILE_PROMPT_RE = /mcp code mode api file qa check/i;

190191191192

type MockScenarioState = {

193+

anthropicThinkingErrorPhase: number;

192194

subagentFanoutPhase: number;

193195

subagentHandoffSpawned: boolean;

194196

};

@@ -3128,6 +3130,90 @@ function buildAnthropicMessageResponse(params: {

31283130

};

31293131

}

313031323133+

const QA_ANTHROPIC_THINKING_ERROR_TEXT =

3134+

"QA replay-safe read completed, but the provider stream failed after signed thinking.";

3135+

const QA_ANTHROPIC_THINKING_ERROR_SIGNATURE = "qa_signed_thinking_block_91953";

3136+

const QA_ANTHROPIC_THINKING_ERROR_MESSAGE = "QA injected provider stream failure";

3137+3138+

function buildAnthropicThinkingErrorResponse(params: { model: string }): Record<string, unknown> {

3139+

return {

3140+

type: "error",

3141+

error: {

3142+

type: "api_error",

3143+

message: QA_ANTHROPIC_THINKING_ERROR_MESSAGE,

3144+

},

3145+

model: params.model || "claude-opus-4-8",

3146+

};

3147+

}

3148+3149+

function buildAnthropicThinkingErrorStreamEvents(params: {

3150+

model: string;

3151+

}): AnthropicStreamEvent[] {

3152+

const messageId = `msg_mock_${Math.floor(Math.random() * 1_000_000).toString(16)}`;

3153+

return [

3154+

{

3155+

type: "message_start",

3156+

message: {

3157+

id: messageId,

3158+

type: "message",

3159+

role: "assistant",

3160+

model: params.model || "claude-opus-4-8",

3161+

content: [],

3162+

stop_reason: null,

3163+

stop_sequence: null,

3164+

usage: {

3165+

input_tokens: 64,

3166+

output_tokens: 0,

3167+

},

3168+

},

3169+

},

3170+

{

3171+

type: "content_block_start",

3172+

index: 0,

3173+

content_block: {

3174+

type: "thinking",

3175+

thinking: "",

3176+

signature: "",

3177+

},

3178+

},

3179+

{

3180+

type: "content_block_delta",

3181+

index: 0,

3182+

delta: {

3183+

type: "thinking_delta",

3184+

thinking: QA_ANTHROPIC_THINKING_ERROR_TEXT,

3185+

},

3186+

},

3187+

{

3188+

type: "content_block_delta",

3189+

index: 0,

3190+

delta: {

3191+

type: "signature_delta",

3192+

signature: QA_ANTHROPIC_THINKING_ERROR_SIGNATURE,

3193+

},

3194+

},

3195+

{

3196+

type: "content_block_stop",

3197+

index: 0,

3198+

},

3199+

{

3200+

type: "message_delta",

3201+

delta: {},

3202+

usage: {

3203+

input_tokens: 64,

3204+

output_tokens: 1120,

3205+

},

3206+

},

3207+

{

3208+

type: "error",

3209+

error: {

3210+

type: "api_error",

3211+

message: QA_ANTHROPIC_THINKING_ERROR_MESSAGE,

3212+

},

3213+

},

3214+

];

3215+

}

3216+31313217

function buildAnthropicMessageStreamEvents(params: {

31323218

model: string;

31333219

extracted: ExtractedAssistantOutput;

@@ -3254,6 +3340,35 @@ async function buildMessagesPayload(

32543340

stream: false,

32553341

...(Array.isArray(body.tools) ? { tools: body.tools } : {}),

32563342

};

3343+

const allInputText = extractAllRequestTexts(input, dispatchBody);

3344+

if (QA_ANTHROPIC_THINKING_ERROR_RECOVERY_PROMPT_RE.test(allInputText)) {

3345+

const toolOutput = extractToolOutput(input);

3346+

const shouldEmitThinkingError =

3347+

toolOutput.length > 0 && scenarioState.anthropicThinkingErrorPhase === 0;

3348+

const events =

3349+

toolOutput.length === 0

3350+

? buildToolCallEventsWithArgs("read", { path: "QA_KICKOFF_TASK.md" })

3351+

: shouldEmitThinkingError

3352+

? (() => {

3353+

scenarioState.anthropicThinkingErrorPhase = 1;

3354+

return buildAssistantEvents("");

3355+

})()

3356+

: buildAssistantEvents("ANTHROPIC-THINKING-ERROR-RECOVERED-OK");

3357+

const extracted = extractFinalAssistantOutputFromEvents(events);

3358+

const responseBody = shouldEmitThinkingError

3359+

? buildAnthropicThinkingErrorResponse({ model: normalizedModel })

3360+

: buildAnthropicMessageResponse({

3361+

model: normalizedModel,

3362+

extracted,

3363+

});

3364+

const streamEvents = shouldEmitThinkingError

3365+

? buildAnthropicThinkingErrorStreamEvents({ model: normalizedModel })

3366+

: buildAnthropicMessageStreamEvents({

3367+

model: normalizedModel,

3368+

extracted,

3369+

});

3370+

return { events, input, extracted, responseBody, streamEvents, model: normalizedModel };

3371+

}

32573372

const events = await buildResponsesPayload(dispatchBody, scenarioState);

32583373

const extracted = extractFinalAssistantOutputFromEvents(events);

32593374

const responseBody = buildAnthropicMessageResponse({

@@ -3270,6 +3385,7 @@ async function buildMessagesPayload(

32703385

export async function startQaMockOpenAiServer(params?: { host?: string; port?: number }) {

32713386

const host = params?.host ?? "127.0.0.1";

32723387

const scenarioState: MockScenarioState = {

3388+

anthropicThinkingErrorPhase: 0,

32733389

subagentFanoutPhase: 0,

32743390

subagentHandoffSpawned: false,

32753391

};