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

推荐订阅源

爱范儿
爱范儿
大猫的无限游戏
大猫的无限游戏
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
Martin Fowler
Martin Fowler
GbyAI
GbyAI
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
U
Unit 42
B
Blog RSS Feed
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
腾讯CDC
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - 聂微东
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta

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): finalize embedded lifecycle backstop · openc...
steipete · 2026-04-30 · via Recent Commits to openclaw:main

@@ -1194,6 +1194,110 @@ describe("runAgentTurnWithFallback", () => {

11941194

});

11951195

});

119611961197+

it("emits an embedded lifecycle terminal backstop when the runner returns without one", async () => {

1198+

const agentEvents = await import("../../infra/agent-events.js");

1199+

const emitAgentEvent = vi.mocked(agentEvents.emitAgentEvent);

1200+

state.runEmbeddedPiAgentMock.mockImplementationOnce(async (params: EmbeddedAgentParams) => {

1201+

await params.onAgentEvent?.({

1202+

stream: "lifecycle",

1203+

data: { phase: "start", startedAt: 1_000 },

1204+

});

1205+

return {

1206+

payloads: [{ text: "Request timed out before a response was generated.", isError: true }],

1207+

meta: { aborted: true, livenessState: "blocked", replayInvalid: true },

1208+

};

1209+

});

1210+1211+

const runAgentTurnWithFallback = await getRunAgentTurnWithFallback();

1212+

const result = await runAgentTurnWithFallback({

1213+

commandBody: "hello",

1214+

followupRun: createFollowupRun(),

1215+

sessionCtx: {

1216+

Provider: "whatsapp",

1217+

MessageSid: "msg",

1218+

} as unknown as TemplateContext,

1219+

opts: { runId: "run-timeout" } as GetReplyOptions,

1220+

typingSignals: createMockTypingSignaler(),

1221+

blockReplyPipeline: null,

1222+

blockStreamingEnabled: false,

1223+

resolvedBlockStreamingBreak: "message_end",

1224+

applyReplyToMode: (payload) => payload,

1225+

shouldEmitToolResult: () => true,

1226+

shouldEmitToolOutput: () => false,

1227+

pendingToolTasks: new Set(),

1228+

resetSessionAfterCompactionFailure: async () => false,

1229+

resetSessionAfterRoleOrderingConflict: async () => false,

1230+

isHeartbeat: false,

1231+

sessionKey: "main",

1232+

getActiveSessionEntry: () => undefined,

1233+

resolvedVerboseLevel: "off",

1234+

});

1235+1236+

expect(result.kind).toBe("success");

1237+

expect(emitAgentEvent).toHaveBeenCalledWith({

1238+

runId: "run-timeout",

1239+

sessionKey: "main",

1240+

stream: "lifecycle",

1241+

data: {

1242+

phase: "end",

1243+

startedAt: 1_000,

1244+

endedAt: expect.any(Number),

1245+

aborted: true,

1246+

livenessState: "blocked",

1247+

replayInvalid: true,

1248+

},

1249+

});

1250+

});

1251+1252+

it("does not duplicate embedded lifecycle terminal events already reported by the runner", async () => {

1253+

const agentEvents = await import("../../infra/agent-events.js");

1254+

const emitAgentEvent = vi.mocked(agentEvents.emitAgentEvent);

1255+

state.runEmbeddedPiAgentMock.mockImplementationOnce(async (params: EmbeddedAgentParams) => {

1256+

await params.onAgentEvent?.({

1257+

stream: "lifecycle",

1258+

data: { phase: "start", startedAt: 1_000 },

1259+

});

1260+

await params.onAgentEvent?.({

1261+

stream: "lifecycle",

1262+

data: { phase: "end", endedAt: 1_500 },

1263+

});

1264+

return { payloads: [{ text: "final" }], meta: {} };

1265+

});

1266+1267+

const runAgentTurnWithFallback = await getRunAgentTurnWithFallback();

1268+

const result = await runAgentTurnWithFallback({

1269+

commandBody: "hello",

1270+

followupRun: createFollowupRun(),

1271+

sessionCtx: {

1272+

Provider: "whatsapp",

1273+

MessageSid: "msg",

1274+

} as unknown as TemplateContext,

1275+

opts: { runId: "run-complete" } as GetReplyOptions,

1276+

typingSignals: createMockTypingSignaler(),

1277+

blockReplyPipeline: null,

1278+

blockStreamingEnabled: false,

1279+

resolvedBlockStreamingBreak: "message_end",

1280+

applyReplyToMode: (payload) => payload,

1281+

shouldEmitToolResult: () => true,

1282+

shouldEmitToolOutput: () => false,

1283+

pendingToolTasks: new Set(),

1284+

resetSessionAfterCompactionFailure: async () => false,

1285+

resetSessionAfterRoleOrderingConflict: async () => false,

1286+

isHeartbeat: false,

1287+

sessionKey: "main",

1288+

getActiveSessionEntry: () => undefined,

1289+

resolvedVerboseLevel: "off",

1290+

});

1291+1292+

expect(result.kind).toBe("success");

1293+

expect(emitAgentEvent).not.toHaveBeenCalledWith(

1294+

expect.objectContaining({

1295+

runId: "run-complete",

1296+

stream: "lifecycle",

1297+

}),

1298+

);

1299+

});

1300+11971301

it("trims chatty GPT ack-turn final prose", async () => {

11981302

state.runWithModelFallbackMock.mockImplementationOnce(async (params: FallbackRunnerParams) => ({

11991303

result: await params.run("openai", "gpt-5.4"),