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

推荐订阅源

J
Java Code Geeks
腾讯CDC
Jina AI
Jina AI
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
GbyAI
GbyAI
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
小众软件
小众软件
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
月光博客
月光博客
L
LangChain Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
C
Check Point Blog
U
Unit 42
人人都是产品经理
人人都是产品经理

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): treat empty group replies as silent · opencl...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -30,6 +30,7 @@ import {

3030

STRICT_AGENTIC_BLOCKED_TEXT,

3131

resolveReplayInvalidFlag,

3232

resolveRunLivenessState,

33+

shouldTreatEmptyAssistantReplyAsSilent,

3334

} from "./run/incomplete-turn.js";

3435

import type { EmbeddedRunAttemptResult } from "./run/types.js";

3536

@@ -1151,6 +1152,138 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

11511152

expect(DEFAULT_EMPTY_RESPONSE_RETRY_LIMIT).toBe(1);

11521153

});

115311541155+

it("treats clean empty assistant turns as silent only when the caller allows it", () => {

1156+

const attempt = makeAttemptResult({

1157+

assistantTexts: [],

1158+

lastAssistant: {

1159+

role: "assistant",

1160+

stopReason: "stop",

1161+

provider: "openai-codex",

1162+

model: "gpt-5.5",

1163+

content: [{ type: "text", text: "" }],

1164+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1165+

});

1166+1167+

expect(

1168+

shouldTreatEmptyAssistantReplyAsSilent({

1169+

allowEmptyAssistantReplyAsSilent: true,

1170+

payloadCount: 0,

1171+

aborted: false,

1172+

timedOut: false,

1173+

attempt,

1174+

}),

1175+

).toBe(true);

1176+

expect(

1177+

shouldTreatEmptyAssistantReplyAsSilent({

1178+

allowEmptyAssistantReplyAsSilent: false,

1179+

payloadCount: 0,

1180+

aborted: false,

1181+

timedOut: false,

1182+

attempt,

1183+

}),

1184+

).toBe(false);

1185+

});

1186+1187+

it("does not treat error or side-effect empty turns as silent", () => {

1188+

const errorAttempt = makeAttemptResult({

1189+

assistantTexts: [],

1190+

lastAssistant: {

1191+

role: "assistant",

1192+

stopReason: "error",

1193+

provider: "openai-codex",

1194+

model: "gpt-5.5",

1195+

content: [],

1196+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1197+

});

1198+

const sideEffectAttempt = makeAttemptResult({

1199+

assistantTexts: [],

1200+

didSendViaMessagingTool: true,

1201+

messagingToolSentTexts: ["sent already"],

1202+

lastAssistant: {

1203+

role: "assistant",

1204+

stopReason: "stop",

1205+

provider: "openai-codex",

1206+

model: "gpt-5.5",

1207+

content: [{ type: "text", text: "" }],

1208+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1209+

});

1210+1211+

expect(

1212+

shouldTreatEmptyAssistantReplyAsSilent({

1213+

allowEmptyAssistantReplyAsSilent: true,

1214+

payloadCount: 0,

1215+

aborted: false,

1216+

timedOut: false,

1217+

attempt: errorAttempt,

1218+

}),

1219+

).toBe(false);

1220+

expect(

1221+

shouldTreatEmptyAssistantReplyAsSilent({

1222+

allowEmptyAssistantReplyAsSilent: true,

1223+

payloadCount: 0,

1224+

aborted: false,

1225+

timedOut: false,

1226+

attempt: sideEffectAttempt,

1227+

}),

1228+

).toBe(false);

1229+

});

1230+1231+

it("returns NO_REPLY without retrying clean empty assistant turns when silence is allowed", async () => {

1232+

mockedClassifyFailoverReason.mockReturnValue(null);

1233+

mockedRunEmbeddedAttempt.mockResolvedValue(

1234+

makeAttemptResult({

1235+

assistantTexts: [],

1236+

lastAssistant: {

1237+

role: "assistant",

1238+

stopReason: "stop",

1239+

provider: "openai-codex",

1240+

model: "gpt-5.5",

1241+

content: [{ type: "text", text: "" }],

1242+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1243+

}),

1244+

);

1245+1246+

const result = await runEmbeddedPiAgent({

1247+

...overflowBaseRunParams,

1248+

allowEmptyAssistantReplyAsSilent: true,

1249+

provider: "openai-codex",

1250+

model: "gpt-5.5",

1251+

runId: "run-empty-assistant-silent",

1252+

});

1253+1254+

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(1);

1255+

expect(result.payloads).toEqual([{ text: "NO_REPLY" }]);

1256+

expect(result.meta.terminalReplyKind).toBe("silent-empty");

1257+

expect(result.meta.livenessState).toBe("working");

1258+

});

1259+1260+

it("keeps retrying and surfacing clean empty assistant turns without the silence flag", async () => {

1261+

mockedClassifyFailoverReason.mockReturnValue(null);

1262+

mockedRunEmbeddedAttempt.mockResolvedValue(

1263+

makeAttemptResult({

1264+

assistantTexts: [],

1265+

lastAssistant: {

1266+

role: "assistant",

1267+

stopReason: "stop",

1268+

provider: "openai",

1269+

model: "gpt-5.4",

1270+

content: [{ type: "text", text: "" }],

1271+

} as unknown as EmbeddedRunAttemptResult["lastAssistant"],

1272+

}),

1273+

);

1274+1275+

const result = await runEmbeddedPiAgent({

1276+

...overflowBaseRunParams,

1277+

provider: "openai",

1278+

model: "gpt-5.4",

1279+

runId: "run-empty-assistant-error",

1280+

});

1281+1282+

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

1283+

expect(result.payloads?.[0]?.isError).toBe(true);

1284+

expect(result.payloads?.[0]?.text).toContain("couldn't generate a response");

1285+

});

1286+11541287

it("detects generic empty Gemini turns without visible text", () => {

11551288

const retryInstruction = resolveEmptyResponseRetryInstruction({

11561289

provider: "google-vertex",