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

推荐订阅源

D
Docker
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
博客园 - 聂微东
S
SegmentFault 最新的问题
量子位
宝玉的分享
宝玉的分享
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
test: dedupe model fallback mock reads · openclaw/opencla...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -268,6 +268,18 @@ function requireRecord(value: unknown, label: string): Record<string, unknown> {

268268

return value as Record<string, unknown>;

269269

}

270270271+

function requireMockCall(

272+

mock: { mock: { calls: unknown[][] } },

273+

index: number,

274+

label: string,

275+

): unknown[] {

276+

const call = mock.mock.calls[index];

277+

if (!call) {

278+

throw new Error(`expected ${label} mock call ${index}`);

279+

}

280+

return call;

281+

}

282+271283

async function captureRejection(promise: Promise<unknown>): Promise<unknown> {

272284

try {

273285

await promise;

@@ -310,8 +322,7 @@ async function expectFallsBackToHaiku(params: {

310322311323

expect(result.result).toBe("ok");

312324

expect(run).toHaveBeenCalledTimes(2);

313-

expect(run.mock.calls.at(1)?.[0]).toBe("anthropic");

314-

expect(run.mock.calls.at(1)?.[1]).toBe("claude-haiku-3-5");

325+

expect(requireMockCall(run, 1, "fallback run")).toEqual(["anthropic", "claude-haiku-3-5"]);

315326

}

316327317328

function createOverrideFailureRun(params: {

@@ -678,7 +689,7 @@ describe("runWithModelFallback", () => {

678689679690

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

680691

expect(run).toHaveBeenCalledTimes(2);

681-

expect(run.mock.calls.at(1)).toEqual(["anthropic", "claude-haiku-3-5"]);

692+

expect(requireMockCall(run, 1, "fallback run")).toEqual(["anthropic", "claude-haiku-3-5"]);

682693

expect(result.attempts[0]?.provider).toBe("openai-codex");

683694

expect(result.attempts[0]?.model).toBe("gpt-5.4");

684695

expect(result.attempts[0]?.reason).toBe("format");

@@ -878,7 +889,7 @@ describe("runWithModelFallback", () => {

878889

});

879890880891

expect(onError).toHaveBeenCalledTimes(1);

881-

const errorCall = requireRecord(onError.mock.calls.at(0)?.[0], "onError payload");

892+

const errorCall = requireRecord(requireMockCall(onError, 0, "onError")[0], "onError payload");

882893

expect(errorCall.provider).toBe("openai");

883894

expect(errorCall.model).toBe("gpt-4.1-mini");

884895

expect(errorCall.attempt).toBe(1);

@@ -1257,7 +1268,7 @@ describe("runWithModelFallback", () => {

1257126812581269

expect(result.result).toBe("ok");

12591270

expect(run).toHaveBeenCalledTimes(2);

1260-

expect(run.mock.calls.at(1)).toEqual(testCase.expectedFallback);

1271+

expect(requireMockCall(run, 1, "fallback run")).toEqual(testCase.expectedFallback);

12611272

if (testCase.expectedReason) {

12621273

expect(result.attempts).toHaveLength(1);

12631274

expect(result.attempts[0]?.reason).toBe(testCase.expectedReason);

@@ -1357,7 +1368,7 @@ describe("runWithModelFallback", () => {

1357136813581369

expect(result.result).toBe("ok");

13591370

expect(run).toHaveBeenCalledTimes(1);

1360-

expect(run.mock.calls.at(0)?.[0]).toBe("openrouter");

1371+

expect(requireMockCall(run, 0, "fallback run")[0]).toBe("openrouter");

13611372

expect(result.attempts).toStrictEqual([]);

13621373

});

13631374