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

推荐订阅源

博客园 - Franky
J
Java Code Geeks
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
L
LangChain Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Martin Fowler
Martin Fowler
月光博客
月光博客
Y
Y Combinator Blog
U
Unit 42
D
Docker
Recent Announcements
Recent Announcements
Hugging Face - Blog
Hugging Face - Blog
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

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: assert fallback cooldown suspension · openclaw/open...
shakkernerd · 2026-05-08 · via Recent Commits to openclaw:main

@@ -73,6 +73,7 @@ let setLoggerOverride: LoggerModule["setLoggerOverride"];

73737474

const makeCfg = makeModelFallbackCfg;

7575

let cleanupLogCapture: (() => void) | undefined;

76+

const OPENAI_PROBE_CANDIDATE = { provider: "openai", model: "gpt-4.1-mini" } as const;

76777778

async function loadModelFallbackProbeModules() {

7879

const authProfilesStoreModule = await import("./auth-profiles/store.js");

@@ -209,7 +210,7 @@ describe("runWithModelFallback – probe logic", () => {

209210

mockedGetSoonestCooldownExpiry.mockReturnValue(params.soonest);

210211

mockedResolveProfilesUnavailableReason.mockReturnValue(params.reason);

211212

return modelFallbackTesting.resolveCooldownDecision({

212-

candidate: { provider: "openai", model: "gpt-4.1-mini" },

213+

candidate: OPENAI_PROBE_CANDIDATE,

213214

isPrimary: params.isPrimary ?? true,

214215

requestedModel: params.requestedModel ?? true,

215216

hasFallbackCandidates: params.hasFallbackCandidates ?? true,

@@ -226,6 +227,17 @@ describe("runWithModelFallback – probe logic", () => {

226227

});

227228

}

228229230+

function expectOpenAiProbeSuspension(

231+

decision: ReturnType<ModelFallbackModule["__testing"]["resolveCooldownDecision"]>,

232+

reason: "rate_limit" | "billing",

233+

) {

234+

expect(decision).toEqual({

235+

type: "suspend_lanes",

236+

reason,

237+

leaderCandidate: OPENAI_PROBE_CANDIDATE,

238+

});

239+

}

240+229241

async function expectPrimarySkippedAfterLongCooldown(reason: "billing" | "rate_limit") {

230242

const cfg = makeCfg();

231243

const expiresIn30Min = NOW + 30 * 60 * 1000;

@@ -323,13 +335,14 @@ describe("runWithModelFallback – probe logic", () => {

323335

).toEqual({ type: "attempt", reason: "rate_limit", markProbe: true });

324336325337

_probeThrottleInternals.lastProbeAttempt.set("recent-openai", NOW - 10_000);

326-

expect(

338+

expectOpenAiProbeSuspension(

327339

resolveOpenAiCooldownDecision({

328340

reason: "rate_limit",

329341

soonest: NOW + 30 * 1000,

330342

throttleKey: "recent-openai",

331343

}),

332-

).toMatchObject({ type: "skip", reason: "rate_limit" });

344+

"rate_limit",

345+

);

333346

});

334347335348

it("logs primary metadata on probe success and failure fallback decisions", async () => {

@@ -633,13 +646,14 @@ describe("runWithModelFallback – probe logic", () => {

633646

const agentBKey = _probeThrottleInternals.resolveProbeThrottleKey("openai", "/tmp/agent-b");

634647

_probeThrottleInternals.lastProbeAttempt.set(agentAKey, NOW - 10_000);

635648636-

expect(

649+

expectOpenAiProbeSuspension(

637650

resolveOpenAiCooldownDecision({

638651

reason: "rate_limit",

639652

soonest: NOW + 30 * 1000,

640653

throttleKey: agentAKey,

641654

}),

642-

).toMatchObject({ type: "skip", reason: "rate_limit" });

655+

"rate_limit",

656+

);

643657

expect(

644658

resolveOpenAiCooldownDecision({

645659

reason: "rate_limit",

@@ -666,11 +680,12 @@ describe("runWithModelFallback – probe logic", () => {

666680

soonest: NOW + 60 * 1000,

667681

}),

668682

).toEqual({ type: "attempt", reason: "billing", markProbe: true });

669-

expect(

683+

expectOpenAiProbeSuspension(

670684

resolveOpenAiCooldownDecision({

671685

reason: "billing",

672686

soonest: NOW + 30 * 60 * 1000,

673687

}),

674-

).toMatchObject({ type: "skip", reason: "billing" });

688+

"billing",

689+

);

675690

});

676691

});