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

推荐订阅源

美团技术团队
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
博客园 - 【当耐特】
B
Blog
Stack Overflow Blog
Stack Overflow Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
博客园 - 司徒正美
博客园 - 叶小钗
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell

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: speed up changed test paths · openclaw/openclaw@64b...
steipete · 2026-05-06 · via Recent Commits to openclaw:main

@@ -1,3 +1,4 @@

1+

import { randomUUID } from "node:crypto";

12

import os from "node:os";

23

import path from "node:path";

34

import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

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

280281

setLoggerOverride({

281282

level: "trace",

282283

consoleLevel: "silent",

283-

file: path.join(os.tmpdir(), `openclaw-model-fallback-probe-${Date.now()}.log`),

284+

file: path.join(os.tmpdir(), `openclaw-model-fallback-probe-${randomUUID()}.log`),

284285

});

285286286287

const run = vi.fn().mockResolvedValue("probed-ok");

@@ -410,19 +411,26 @@ describe("runWithModelFallback – probe logic", () => {

410411

expectPrimaryProbeSuccess(result, run, "recovered");

411412

});

412413413-

it("attempts non-primary fallbacks during rate-limit cooldown after primary probe failure", async () => {

414-

await expectProbeFailureFallsBack({

415-

reason: "rate_limit",

414+

it.each([

415+

{

416+

label: "rate-limit",

417+

reason: "rate_limit" as const,

416418

probeError: Object.assign(new Error("rate limited"), { status: 429 }),

417-

});

418-

});

419-420-

it("attempts non-primary fallbacks during overloaded cooldown after primary probe failure", async () => {

421-

await expectProbeFailureFallsBack({

422-

reason: "overloaded",

419+

},

420+

{

421+

label: "overloaded",

422+

reason: "overloaded" as const,

423423

probeError: Object.assign(new Error("service overloaded"), { status: 503 }),

424-

});

425-

});

424+

},

425+

])(

426+

"attempts non-primary fallbacks during $label cooldown after primary probe failure",

427+

async ({ reason, probeError }) => {

428+

await expectProbeFailureFallsBack({

429+

reason,

430+

probeError,

431+

});

432+

},

433+

);

426434427435

it("keeps walking remaining fallbacks after an abort-wrapped RESOURCE_EXHAUSTED probe failure", async () => {

428436

const cfg = makeCfg({

@@ -556,38 +564,22 @@ describe("runWithModelFallback – probe logic", () => {

556564

expect(_probeThrottleInternals.lastProbeAttempt.has("key-0")).toBe(true);

557565

});

558566559-

it("handles non-finite soonest safely (treats as probe-worthy)", async () => {

560-

const cfg = makeCfg();

561-562-

// Return Infinity — should be treated as "probe" per the guard

563-

mockedGetSoonestCooldownExpiry.mockReturnValue(Infinity);

564-565-

const run = vi.fn().mockResolvedValue("ok-infinity");

566-567-

const result = await runPrimaryCandidate(cfg, run);

568-

expectPrimaryProbeSuccess(result, run, "ok-infinity");

569-

});

570-571-

it("handles NaN soonest safely (treats as probe-worthy)", async () => {

572-

const cfg = makeCfg();

573-574-

mockedGetSoonestCooldownExpiry.mockReturnValue(Number.NaN);

575-576-

const run = vi.fn().mockResolvedValue("ok-nan");

577-578-

const result = await runPrimaryCandidate(cfg, run);

579-

expectPrimaryProbeSuccess(result, run, "ok-nan");

580-

});

581-582-

it("handles null soonest safely (treats as probe-worthy)", async () => {

567+

it("handles missing or non-finite soonest safely (treats as probe-worthy)", async () => {

583568

const cfg = makeCfg();

584569585-

mockedGetSoonestCooldownExpiry.mockReturnValue(null);

570+

for (const [label, soonest] of [

571+

["infinity", Infinity],

572+

["nan", Number.NaN],

573+

["null", null],

574+

] as const) {

575+

_probeThrottleInternals.lastProbeAttempt.clear();

576+

mockedGetSoonestCooldownExpiry.mockReturnValue(soonest);

586577587-

const run = vi.fn().mockResolvedValue("ok-null");

578+

const run = vi.fn().mockResolvedValue(`ok-${label}`);

588579589-

const result = await runPrimaryCandidate(cfg, run);

590-

expectPrimaryProbeSuccess(result, run, "ok-null");

580+

const result = await runPrimaryCandidate(cfg, run);

581+

expectPrimaryProbeSuccess(result, run, `ok-${label}`);

582+

}

591583

});

592584593585

it("single candidate skips with rate_limit and exhausts candidates", async () => {

@@ -700,8 +692,4 @@ describe("runWithModelFallback – probe logic", () => {

700692701693

expectPrimaryProbeSuccess(result, run, "billing-probe-ok");

702694

});

703-704-

it("skips billing-cooldowned primary with fallbacks when far from cooldown expiry", async () => {

705-

await expectPrimarySkippedAfterLongCooldown("billing");

706-

});

707695

});