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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
博客园_首页
Jina AI
Jina AI
WordPress大学
WordPress大学
小众软件
小众软件
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
美团技术团队
IT之家
IT之家
爱范儿
爱范儿
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】

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): add openai-responses family to non-visible t...
SebTardif · 2026-05-23 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

15941594

expect(retryInstruction).toBeNull();

15951595

});

15961596
1597+

it("retries empty openai-codex-responses turns with non-zero output tokens (#85364)", () => {

1598+

const retryInstruction = resolveEmptyResponseRetryInstruction({

1599+

provider: "openai-codex",

1600+

modelId: "gpt-5.5",

1601+

modelApi: "openai-codex-responses",

1602+

payloadCount: 0,

1603+

aborted: false,

1604+

timedOut: false,

1605+

attempt: makeAttemptResult({

1606+

assistantTexts: [],

1607+

lastAssistant: {

1608+

role: "assistant",

1609+

stopReason: "stop",

1610+

provider: "openai-codex",

1611+

model: "gpt-5.5",

1612+

content: [],

1613+

usage: { input: 24794, output: 111, cacheRead: 4608, totalTokens: 29513 },

1614+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1615+

}),

1616+

});

1617+
1618+

expect(retryInstruction).toBe(EMPTY_RESPONSE_RETRY_INSTRUCTION);

1619+

});

1620+
1621+

it("retries empty openai-responses turns without visible text", () => {

1622+

const retryInstruction = resolveEmptyResponseRetryInstruction({

1623+

provider: "openai",

1624+

modelId: "gpt-5.5",

1625+

modelApi: "openai-responses",

1626+

payloadCount: 0,

1627+

aborted: false,

1628+

timedOut: false,

1629+

attempt: makeAttemptResult({

1630+

assistantTexts: [],

1631+

lastAssistant: {

1632+

role: "assistant",

1633+

stopReason: "stop",

1634+

provider: "openai",

1635+

model: "gpt-5.5",

1636+

content: [],

1637+

usage: { input: 5000, output: 200, totalTokens: 5200 },

1638+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1639+

}),

1640+

});

1641+
1642+

expect(retryInstruction).toBe(EMPTY_RESPONSE_RETRY_INSTRUCTION);

1643+

});

1644+
15971645

it("retries generic empty OpenAI-compatible turns from custom endpoints", () => {

15981646

const retryInstruction = resolveEmptyResponseRetryInstruction({

15991647

provider: "llama-cpp-local",

Original file line numberDiff line numberDiff line change

@@ -133,6 +133,19 @@ const GEMINI_INCOMPLETE_TURN_MODEL_ID_PATTERN = /^gemini(?:[.-]|$)/;

133133

// Ollama native `/api/chat` can finish with only thinking/internal blocks when

134134

// constrained, but it should not inherit the stricter planning-only/ack prompts.

135135

const OLLAMA_INCOMPLETE_TURN_PROVIDER_ID_PATTERN = /^ollama(?:-|$)/;

136+

// Model APIs eligible for the non-visible turn retry guard. OpenAI Responses

137+

// family can produce reasoning-only turns where usage.output > 0 but no visible

138+

// text is emitted; without the guard these pass through as successful. (#85364)

139+

const RETRY_GUARD_MODEL_APIS = new Set([

140+

"openai-completions",

141+

"anthropic-messages",

142+

"bedrock-converse-stream",

143+

"openai-responses",

144+

"openai-codex-responses",

145+

"azure-openai-responses",

146+

"openclaw-openai-responses-transport",

147+

"openclaw-azure-openai-responses-transport",

148+

]);

136149

const DEFAULT_PLANNING_ONLY_RETRY_LIMIT = 1;

137150

const STRICT_AGENTIC_PLANNING_ONLY_RETRY_LIMIT = 2;

138151

// Allow one immediate continuation plus one follow-up continuation before

@@ -627,11 +640,7 @@ function shouldApplyNonVisibleTurnRetryGuard(params: {

627640

if (shouldApplyPlanningOnlyRetryGuard(params)) {

628641

return true;

629642

}

630-

if (

631-

normalizeLowercaseStringOrEmpty(params.modelApi ?? "") === "openai-completions" ||

632-

normalizeLowercaseStringOrEmpty(params.modelApi ?? "") === "anthropic-messages" ||

633-

normalizeLowercaseStringOrEmpty(params.modelApi ?? "") === "bedrock-converse-stream"

634-

) {

643+

if (RETRY_GUARD_MODEL_APIS.has(normalizeLowercaseStringOrEmpty(params.modelApi ?? ""))) {

635644

return true;

636645

}

637646

// Non-visible final turns are narrower than planning-only turns: there is no