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

推荐订阅源

H
Help Net Security
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
博客园_首页
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
B
Blog
D
DataBreaches.Net
腾讯CDC
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
月光博客
月光博客
V
V2EX
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
博客园 - 叶小钗
Y
Y Combinator 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 #95489: [Bug]: claude-cli out-of-credits error bypass...
mikasa0818 · 2026-06-23 · via Recent Commits to openclaw:main
11

/**

22

* Classifies embedded-agent run results for model fallback decisions.

33

*/

4+

import { GENERIC_EXTERNAL_RUN_FAILURE_TEXT } from "../../auto-reply/reply/agent-runner-failure-copy.js";

45

import { isSilentReplyPayloadText } from "../../auto-reply/tokens.js";

56

import { classifyFailoverReason } from "../embedded-agent-helpers/errors.js";

67

import type { FailoverReason } from "../embedded-agent-helpers/types.js";

@@ -15,8 +16,9 @@ import type { EmbeddedAgentRunResult } from "./types.js";

1516

/**

1617

* Classifies embedded-agent terminal results for model fallback decisions.

1718

*

18-

* The classifier only flags failed invisible outcomes; delivered messages, deliberate silent

19-

* replies, hook blocks, and aborts must not trigger another model attempt.

19+

* The classifier only flags failed invisible outcomes or exact generic external-runner failure

20+

* copy; delivered messages, deliberate silent replies, hook blocks, and aborts must not trigger

21+

* another model attempt.

2022

*/

2123

function isEmbeddedAgentRunResult(value: unknown): value is EmbeddedAgentRunResult {

2224

return Boolean(

@@ -74,6 +76,47 @@ function hasDeliberateSilentTerminalReply(result: EmbeddedAgentRunResult): boole

7476

);

7577

}

767879+

function hasNonTextVisiblePayloadContent(

80+

payload: NonNullable<EmbeddedAgentRunResult["payloads"]>[number],

81+

): boolean {

82+

const { text: _text, ...payloadWithoutText } = payload;

83+

return hasVisibleAgentPayload(

84+

{ payloads: [payloadWithoutText] },

85+

{

86+

includeErrorPayloads: false,

87+

includeReasoningPayloads: false,

88+

},

89+

);

90+

}

91+92+

function classifyGenericExternalRunFailurePayload(params: {

93+

provider: string;

94+

model: string;

95+

result: EmbeddedAgentRunResult;

96+

}): ModelFallbackResultClassification {

97+

const payloads = params.result.payloads;

98+

if (!Array.isArray(payloads) || payloads.length !== 1) {

99+

return null;

100+

}

101+

const [payload] = payloads;

102+

const text = payload?.text;

103+

if (

104+

payload?.isError === true ||

105+

payload?.isReasoning === true ||

106+

typeof text !== "string" ||

107+

text.trim() !== GENERIC_EXTERNAL_RUN_FAILURE_TEXT ||

108+

hasNonTextVisiblePayloadContent(payload)

109+

) {

110+

return null;

111+

}

112+

return {

113+

message: `${params.provider}/${params.model} ended with a generic external runner failure: ${text}`,

114+

reason: "format",

115+

code: "generic_external_run_failure",

116+

rawError: text,

117+

};

118+

}

119+77120

function classifyHarnessResult(params: {

78121

provider: string;

79122

model: string;

@@ -136,11 +179,7 @@ export function classifyEmbeddedAgentRunResultForModelFallback(params: {

136179

if (

137180

params.result.meta.aborted ||

138181

params.hasDirectlySentBlockReply === true ||

139-

params.hasBlockReplyPipelineOutput === true ||

140-

hasVisibleAgentPayload(params.result, {

141-

includeErrorPayloads: false,

142-

includeReasoningPayloads: false,

143-

})

182+

params.hasBlockReplyPipelineOutput === true

144183

) {

145184

return null;

146185

}

@@ -161,6 +200,22 @@ export function classifyEmbeddedAgentRunResultForModelFallback(params: {

161200

return null;

162201

}

163202

const payloads = params.result.payloads ?? [];

203+

const genericExternalFailureClassification = classifyGenericExternalRunFailurePayload({

204+

provider: params.provider,

205+

model: params.model,

206+

result: params.result,

207+

});

208+

if (genericExternalFailureClassification) {

209+

return genericExternalFailureClassification;

210+

}

211+

if (

212+

hasVisibleAgentPayload(params.result, {

213+

includeErrorPayloads: false,

214+

includeReasoningPayloads: false,

215+

})

216+

) {

217+

return null;

218+

}

164219165220

if (fallbackSafeIncompleteTurn) {

166221

const terminalErrorText = payloads.find(