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

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
J
Java Code Geeks
Jina AI
Jina AI
B
Blog RSS Feed
量子位
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
博客园 - 聂微东
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
I
InfoQ
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Y
Y Combinator Blog
Vercel News
Vercel News
雷峰网
雷峰网

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(agent): retry empty anthropic-compatible replies · op...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -817,6 +817,75 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

817817

expectWarnMessageWith("empty response detected");

818818

});

819819820+

it("retries empty Anthropic-compatible stop turns even when the provider is not Kimi", async () => {

821+

mockedClassifyFailoverReason.mockReturnValue(null);

822+

mockedResolveModelAsync.mockResolvedValue({

823+

model: {

824+

id: "claude-opus-4-7",

825+

provider: "sub2api",

826+

contextWindow: 200000,

827+

api: "anthropic-messages",

828+

},

829+

error: null,

830+

authStorage: {

831+

setRuntimeApiKey: vi.fn(),

832+

},

833+

modelRegistry: {},

834+

});

835+

mockedRunEmbeddedAttempt.mockResolvedValueOnce(

836+

makeAttemptResult({

837+

assistantTexts: [],

838+

lastAssistant: {

839+

role: "assistant",

840+

api: "anthropic-messages",

841+

stopReason: "stop",

842+

provider: "sub2api",

843+

model: "claude-opus-4-7",

844+

content: [],

845+

usage: {

846+

input: 2048,

847+

output: 3100,

848+

cacheRead: 0,

849+

cacheWrite: 0,

850+

totalTokens: 5148,

851+

},

852+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

853+

}),

854+

);

855+

mockedRunEmbeddedAttempt.mockResolvedValueOnce(

856+

makeAttemptResult({

857+

assistantTexts: ["Visible Anthropic-compatible answer."],

858+

lastAssistant: {

859+

role: "assistant",

860+

api: "anthropic-messages",

861+

stopReason: "stop",

862+

provider: "sub2api",

863+

model: "claude-opus-4-7",

864+

content: [{ type: "text", text: "Visible Anthropic-compatible answer." }],

865+

usage: {

866+

input: 2300,

867+

output: 8,

868+

cacheRead: 0,

869+

cacheWrite: 0,

870+

totalTokens: 2308,

871+

},

872+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

873+

}),

874+

);

875+876+

await runEmbeddedPiAgent({

877+

...overflowBaseRunParams,

878+

provider: "sub2api",

879+

model: "claude-opus-4-7",

880+

runId: "run-empty-anthropic-compatible-stop-continuation",

881+

});

882+883+

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

884+

const secondCall = runAttemptCall(1);

885+

expect(secondCall.prompt).toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

886+

expectWarnMessageWith("empty response detected");

887+

});

888+820889

it("surfaces an error after exhausting empty-response retries", async () => {

821890

mockedClassifyFailoverReason.mockReturnValue(null);

822891

mockedRunEmbeddedAttempt.mockResolvedValue(