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

推荐订阅源

Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
博客园_首页
量子位
雷峰网
雷峰网
GbyAI
GbyAI
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Cloudflare Blog
IT之家
IT之家
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东

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(cli): mark embedded agent fallback (#72730) · opencla...
amknight · 2026-04-27 · via Recent Commits to openclaw:main

@@ -173,26 +173,80 @@ describe("agentCliCommand", () => {

173173174174

expect(callGateway).toHaveBeenCalledTimes(1);

175175

expect(agentCommand).toHaveBeenCalledTimes(1);

176+

expect(agentCommand.mock.calls[0]?.[0]).toMatchObject({

177+

resultMetaOverrides: {

178+

transport: "embedded",

179+

fallbackFrom: "gateway",

180+

},

181+

});

182+

expect(runtime.error).toHaveBeenCalledWith(

183+

expect.stringContaining("EMBEDDED FALLBACK: Gateway agent failed"),

184+

);

176185

expect(runtime.log).toHaveBeenCalledWith("local");

177186

});

178187

});

179188180-

it("keeps diagnostics on stderr before JSON embedded fallback", async () => {

189+

it("passes fallback metadata into JSON embedded fallback output", async () => {

181190

await withTempStore(async () => {

182191

callGateway.mockRejectedValue(new Error("gateway not connected"));

183-

agentCommand.mockImplementationOnce(async (_opts, rt) => {

192+

agentCommand.mockImplementationOnce(async (opts, rt) => {

184193

expect(loggingState.forceConsoleToStderr).toBe(true);

185-

rt?.log?.("local");

194+

const resultMetaOverrides = (

195+

opts as {

196+

resultMetaOverrides?: { transport?: string; fallbackFrom?: string };

197+

}

198+

).resultMetaOverrides;

199+

const meta = {

200+

durationMs: 1,

201+

agentMeta: { sessionId: "s", provider: "p", model: "m" },

202+

...resultMetaOverrides,

203+

};

204+

rt?.log?.(

205+

JSON.stringify(

206+

{

207+

payloads: [{ text: "local" }],

208+

meta,

209+

},

210+

null,

211+

2,

212+

),

213+

);

186214

return {

187215

payloads: [{ text: "local" }],

188-

meta: { durationMs: 1, agentMeta: { sessionId: "s", provider: "p", model: "m" } },

216+

meta,

189217

} as unknown as Awaited<ReturnType<typeof AgentCommand>>;

190218

});

191219192-

await agentCliCommand({ message: "hi", to: "+1555", json: true }, jsonRuntime);

220+

const result = await agentCliCommand({ message: "hi", to: "+1555", json: true }, jsonRuntime);

193221194222

expect(agentCommand).toHaveBeenCalledTimes(1);

223+

expect(agentCommand.mock.calls[0]?.[0]).toMatchObject({

224+

resultMetaOverrides: {

225+

transport: "embedded",

226+

fallbackFrom: "gateway",

227+

},

228+

});

229+

expect(jsonRuntime.error).toHaveBeenCalledWith(

230+

expect.stringContaining("EMBEDDED FALLBACK: Gateway agent failed"),

231+

);

195232

expect(loggingState.forceConsoleToStderr).toBe(true);

233+

expect(jsonRuntime.log).toHaveBeenCalledTimes(1);

234+

const payload = JSON.parse(String(jsonRuntime.log.mock.calls[0]?.[0]));

235+

expect(payload).toMatchObject({

236+

payloads: [{ text: "local" }],

237+

meta: {

238+

durationMs: 1,

239+

transport: "embedded",

240+

fallbackFrom: "gateway",

241+

},

242+

});

243+

expect(result).toMatchObject({

244+

meta: {

245+

durationMs: 1,

246+

transport: "embedded",

247+

fallbackFrom: "gateway",

248+

},

249+

});

196250

});

197251

});

198252

@@ -214,6 +268,7 @@ describe("agentCliCommand", () => {

214268

expect(agentCommand.mock.calls[0]?.[0]).toMatchObject({

215269

cleanupBundleMcpOnRunEnd: true,

216270

});

271+

expect(agentCommand.mock.calls[0]?.[0]).not.toHaveProperty("resultMetaOverrides");

217272

expect(runtime.log).toHaveBeenCalledWith("local");

218273

});

219274

});