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

推荐订阅源

Google DeepMind News
Google DeepMind News
D
Docker
Last Week in AI
Last Week in AI
WordPress大学
WordPress大学
月光博客
月光博客
小众软件
小众软件
量子位
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
博客园 - 叶小钗
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
C
Check Point Blog

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: tighten model fallback probe assertions · openclaw/...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -143,6 +143,23 @@ function expectPrimaryProbeSuccess(

143143

});

144144

}

145145146+

function requireRecord(value: unknown, label: string): Record<string, unknown> {

147+

if (!value || typeof value !== "object") {

148+

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

149+

}

150+

return value as Record<string, unknown>;

151+

}

152+153+

function expectRecordWithFields(

154+

records: Array<Record<string, unknown>>,

155+

expected: Record<string, unknown>,

156+

) {

157+

const matching = records.find((record) =>

158+

Object.entries(expected).every(([key, value]) => record[key] === value),

159+

);

160+

expect(matching, `expected matching record for ${JSON.stringify(expected)}`).toBeDefined();

161+

}

162+146163

async function expectProbeFailureFallsBack({

147164

reason,

148165

probeError,

@@ -398,77 +415,73 @@ describe("runWithModelFallback – probe logic", () => {

398415399416

const decisionPayloads = logCapture.records

400417

.filter((record) => record.message === "model fallback decision")

401-

.map((record) => record.attributes ?? {});

402-403-

expect(decisionPayloads).toEqual(

404-

expect.arrayContaining([

405-

expect.objectContaining({

406-

event: "model_fallback_decision",

407-

decision: "probe_cooldown_candidate",

408-

candidateProvider: "openai",

409-

candidateModel: "gpt-4.1-mini",

410-

allowTransientCooldownProbe: true,

411-

}),

412-

expect.objectContaining({

413-

event: "model_fallback_decision",

414-

decision: "candidate_succeeded",

415-

candidateProvider: "openai",

416-

candidateModel: "gpt-4.1-mini",

417-

isPrimary: true,

418-

requestedModelMatched: true,

419-

}),

420-

expect.objectContaining({

421-

event: "model_fallback_decision",

422-

decision: "candidate_failed",

423-

candidateProvider: "openai",

424-

candidateModel: "gpt-4.1-mini",

425-

isPrimary: true,

426-

requestedModelMatched: true,

427-

nextCandidateProvider: "anthropic",

428-

nextCandidateModel: "claude-haiku-3-5",

429-

fallbackStepType: "fallback_step",

430-

fallbackStepFromModel: "openai/gpt-4.1-mini",

431-

fallbackStepToModel: "anthropic/claude-haiku-3-5",

432-

fallbackStepFromFailureReason: "rate_limit",

433-

fallbackStepChainPosition: 1,

434-

fallbackStepFinalOutcome: "next_fallback",

435-

}),

436-

expect.objectContaining({

437-

event: "model_fallback_decision",

438-

decision: "candidate_succeeded",

439-

candidateProvider: "anthropic",

440-

candidateModel: "claude-haiku-3-5",

441-

isPrimary: false,

442-

requestedModelMatched: false,

443-

fallbackStepType: "fallback_step",

444-

fallbackStepFromModel: "openai/gpt-4.1-mini",

445-

fallbackStepToModel: "anthropic/claude-haiku-3-5",

446-

fallbackStepFromFailureReason: "rate_limit",

447-

fallbackStepChainPosition: 2,

448-

fallbackStepFinalOutcome: "succeeded",

449-

}),

450-

]),

451-

);

452-

expect(onFallbackStep).toHaveBeenCalledWith(

453-

expect.objectContaining({

454-

fallbackStepType: "fallback_step",

455-

fallbackStepFromModel: "openai/gpt-4.1-mini",

456-

fallbackStepToModel: "anthropic/claude-haiku-3-5",

457-

fallbackStepFromFailureReason: "rate_limit",

458-

fallbackStepChainPosition: 1,

459-

fallbackStepFinalOutcome: "next_fallback",

460-

}),

461-

);

462-

expect(onFallbackStep).toHaveBeenCalledWith(

463-

expect.objectContaining({

464-

fallbackStepType: "fallback_step",

465-

fallbackStepFromModel: "openai/gpt-4.1-mini",

466-

fallbackStepToModel: "anthropic/claude-haiku-3-5",

467-

fallbackStepFromFailureReason: "rate_limit",

468-

fallbackStepChainPosition: 2,

469-

fallbackStepFinalOutcome: "succeeded",

470-

}),

418+

.map((record) => requireRecord(record.attributes, "decision payload"));

419+420+

expectRecordWithFields(decisionPayloads, {

421+

event: "model_fallback_decision",

422+

decision: "probe_cooldown_candidate",

423+

candidateProvider: "openai",

424+

candidateModel: "gpt-4.1-mini",

425+

allowTransientCooldownProbe: true,

426+

});

427+

expectRecordWithFields(decisionPayloads, {

428+

event: "model_fallback_decision",

429+

decision: "candidate_succeeded",

430+

candidateProvider: "openai",

431+

candidateModel: "gpt-4.1-mini",

432+

isPrimary: true,

433+

requestedModelMatched: true,

434+

});

435+

expectRecordWithFields(decisionPayloads, {

436+

event: "model_fallback_decision",

437+

decision: "candidate_failed",

438+

candidateProvider: "openai",

439+

candidateModel: "gpt-4.1-mini",

440+

isPrimary: true,

441+

requestedModelMatched: true,

442+

nextCandidateProvider: "anthropic",

443+

nextCandidateModel: "claude-haiku-3-5",

444+

fallbackStepType: "fallback_step",

445+

fallbackStepFromModel: "openai/gpt-4.1-mini",

446+

fallbackStepToModel: "anthropic/claude-haiku-3-5",

447+

fallbackStepFromFailureReason: "rate_limit",

448+

fallbackStepChainPosition: 1,

449+

fallbackStepFinalOutcome: "next_fallback",

450+

});

451+

expectRecordWithFields(decisionPayloads, {

452+

event: "model_fallback_decision",

453+

decision: "candidate_succeeded",

454+

candidateProvider: "anthropic",

455+

candidateModel: "claude-haiku-3-5",

456+

isPrimary: false,

457+

requestedModelMatched: false,

458+

fallbackStepType: "fallback_step",

459+

fallbackStepFromModel: "openai/gpt-4.1-mini",

460+

fallbackStepToModel: "anthropic/claude-haiku-3-5",

461+

fallbackStepFromFailureReason: "rate_limit",

462+

fallbackStepChainPosition: 2,

463+

fallbackStepFinalOutcome: "succeeded",

464+

});

465+466+

const fallbackSteps = onFallbackStep.mock.calls.map(([step]) =>

467+

requireRecord(step, "fallback step"),

471468

);

469+

expectRecordWithFields(fallbackSteps, {

470+

fallbackStepType: "fallback_step",

471+

fallbackStepFromModel: "openai/gpt-4.1-mini",

472+

fallbackStepToModel: "anthropic/claude-haiku-3-5",

473+

fallbackStepFromFailureReason: "rate_limit",

474+

fallbackStepChainPosition: 1,

475+

fallbackStepFinalOutcome: "next_fallback",

476+

});

477+

expectRecordWithFields(fallbackSteps, {

478+

fallbackStepType: "fallback_step",

479+

fallbackStepFromModel: "openai/gpt-4.1-mini",

480+

fallbackStepToModel: "anthropic/claude-haiku-3-5",

481+

fallbackStepFromFailureReason: "rate_limit",

482+

fallbackStepChainPosition: 2,

483+

fallbackStepFinalOutcome: "succeeded",

484+

});

472485

});

473486474487

it.each([