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

推荐订阅源

B
Blog
V
Vulnerabilities – Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
美团技术团队
aimingoo的专栏
aimingoo的专栏
Google Online Security Blog
Google Online Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threatpost
Y
Y Combinator Blog
T
Tailwind CSS Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
小众软件
小众软件
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Tenable Blog
W
WeLiveSecurity
L
LINUX DO - 热门话题
D
Docker
Cyberwarzone
Cyberwarzone
量子位
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
O
OpenAI News
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
IT之家
IT之家
S
Secure Thoughts
MongoDB | Blog
MongoDB | Blog
L
Lohrmann on Cybersecurity
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: tighten auth profile rotation assertions · openclaw/openclaw@4769d40
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -582,6 +582,60 @@ async function withAgentWorkspace<T>(

582582

}

583583

}

584584585+

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

586+

if (value === null || typeof value !== "object" || Array.isArray(value)) {

587+

throw new Error(`expected ${label} to be a record`);

588+

}

589+

return value as Record<string, unknown>;

590+

}

591+592+

function requireLogRecord(

593+

records: ReadonlyArray<unknown>,

594+

message: string,

595+

): Record<string, unknown> {

596+

const record = records.find(

597+

(candidate) => requireRecord(candidate, "log record").message === message,

598+

);

599+

if (!record) {

600+

throw new Error(`expected log record: ${message}`);

601+

}

602+

return requireRecord(record, message);

603+

}

604+605+

async function expectFailoverError(

606+

promise: Promise<unknown>,

607+

expected: {

608+

name?: string;

609+

profileId?: string;

610+

reason?: string;

611+

provider?: string;

612+

model?: string;

613+

},

614+

) {

615+

let thrown: unknown;

616+

try {

617+

await promise;

618+

} catch (error) {

619+

thrown = error;

620+

}

621+

expect(thrown).toBeInstanceOf(Error);

622+

const errorRecord = requireRecord(thrown, "failover error");

623+

expect(errorRecord.name).toBe(expected.name ?? "FailoverError");

624+

if (expected.profileId !== undefined) {

625+

expect(errorRecord.profileId).toBe(expected.profileId);

626+

}

627+

if (expected.reason !== undefined) {

628+

expect(errorRecord.reason).toBe(expected.reason);

629+

}

630+

if (expected.provider !== undefined) {

631+

expect(errorRecord.provider).toBe(expected.provider);

632+

}

633+

if (expected.model !== undefined) {

634+

expect(errorRecord.model).toBe(expected.model);

635+

}

636+

return errorRecord;

637+

}

638+585639

async function runTurnWithCooldownSeed(params: {

586640

sessionKey: string;

587641

runId: string;

@@ -863,37 +917,33 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

863917

await logCapture.flush();

864918865919

const safeProfileId = redactIdentifier("openai:p1", { len: 12 });

866-

expect(logCapture.records).toEqual(

867-

expect.arrayContaining([

868-

expect.objectContaining({

869-

message: "embedded run failover decision",

870-

attributes: expect.objectContaining({

871-

event: "embedded_run_failover_decision",

872-

runId: "run:overloaded-logging",

873-

decision: "rotate_profile",

874-

failoverReason: "overloaded",

875-

profileId: safeProfileId,

876-

sourceProvider: "openai",

877-

sourceModel: "mock-1",

878-

providerErrorType: "overloaded_error",

879-

rawErrorPreview: expect.stringContaining('"request_id":"sha256:'),

880-

}),

881-

}),

882-

]),

920+

const failoverDecision = requireLogRecord(logCapture.records, "embedded run failover decision");

921+

const failoverAttributes = requireRecord(

922+

failoverDecision.attributes,

923+

"failover decision attributes",

883924

);

884-

expect(logCapture.records).toEqual(

885-

expect.arrayContaining([

886-

expect.objectContaining({

887-

message: "auth profile failure state updated",

888-

attributes: expect.objectContaining({

889-

event: "auth_profile_failure_state_updated",

890-

runId: "run:overloaded-logging",

891-

profileId: safeProfileId,

892-

reason: "overloaded",

893-

}),

894-

}),

895-

]),

925+

expect(failoverAttributes.event).toBe("embedded_run_failover_decision");

926+

expect(failoverAttributes.runId).toBe("run:overloaded-logging");

927+

expect(failoverAttributes.decision).toBe("rotate_profile");

928+

expect(failoverAttributes.failoverReason).toBe("overloaded");

929+

expect(failoverAttributes.profileId).toBe(safeProfileId);

930+

expect(failoverAttributes.sourceProvider).toBe("openai");

931+

expect(failoverAttributes.sourceModel).toBe("mock-1");

932+

expect(failoverAttributes.providerErrorType).toBe("overloaded_error");

933+

expect(failoverAttributes.rawErrorPreview).toContain('"request_id":"sha256:');

934+935+

const failureStateUpdate = requireLogRecord(

936+

logCapture.records,

937+

"auth profile failure state updated",

896938

);

939+

const failureStateAttributes = requireRecord(

940+

failureStateUpdate.attributes,

941+

"failure state attributes",

942+

);

943+

expect(failureStateAttributes.event).toBe("auth_profile_failure_state_updated");

944+

expect(failureStateAttributes.runId).toBe("run:overloaded-logging");

945+

expect(failureStateAttributes.profileId).toBe(safeProfileId);

946+

expect(failureStateAttributes.reason).toBe("overloaded");

897947

});

898948899949

it("rotates for overloaded prompt failures across auto-pinned profiles", async () => {

@@ -908,7 +958,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

908958

expect(sleepWithAbortMock).not.toHaveBeenCalled();

909959

});

910960911-

it("starts the retry attempt before prompt failure cooldown marking finishes", async () => {

961+

it("waits for prompt failure cooldown marking before retrying", async () => {

912962

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

913963

const markCanFinish = new Promise<void>((resolve) => {

914964

releaseMark = resolve;

@@ -934,10 +984,11 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

934984

runId: "run:prompt-deferred-mark",

935985

});

936986937-

await vi.waitFor(() => expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(2));

938-

expect(markStarted).toBe(true);

987+

await vi.waitFor(() => expect(markStarted).toBe(true));

988+

expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(1);

939989

releaseMark?.();

940990

releaseMark = undefined;

991+

await vi.waitFor(() => expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(2));

941992

await runPromise;

942993943994

const usageStats = await readUsageStats(agentDir);

@@ -1067,7 +1118,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

1067111810681119

mockSingleErrorAttempt({ errorMessage: "rate limit" });

106911201070-

await expect(

1121+

await expectFailoverError(

10711122

runEmbeddedPiAgentInline({

10721123

sessionId: "session:test",

10731124

sessionKey: "agent:test:user",

@@ -1083,13 +1134,13 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

10831134

timeoutMs: 5_000,

10841135

runId: "run:user",

10851136

}),

1086-

).rejects.toMatchObject({

1087-

name: "FailoverError",

1088-

profileId: "openai:p1",

1089-

reason: "rate_limit",

1090-

provider: "openai",

1091-

model: "mock-1",

1092-

});

1137+

{

1138+

profileId: "openai:p1",

1139+

reason: "rate_limit",

1140+

provider: "openai",

1141+

model: "mock-1",

1142+

},

1143+

);

1093114410941145

expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(1);

10951146

await expectProfileP2UsageUnchanged(agentDir);

@@ -1164,11 +1215,13 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

11641215

});

1165121611661217

expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(1);

1167-

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

1168-

authProfileId: "openai-codex:work",

1169-

authProfileIdSource: "user",

1170-

provider: "codex-cli",

1171-

});

1218+

const attemptParams = requireRecord(

1219+

runEmbeddedAttemptMock.mock.calls[0]?.[0],

1220+

"embedded attempt params",

1221+

);

1222+

expect(attemptParams.authProfileId).toBe("openai-codex:work");

1223+

expect(attemptParams.authProfileIdSource).toBe("user");

1224+

expect(attemptParams.provider).toBe("codex-cli");

11721225

});

11731226

});

11741227

@@ -1227,7 +1280,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

12271280

},

12281281

});

122912821230-

await expect(

1283+

await expectFailoverError(

12311284

runEmbeddedPiAgentInline({

12321285

sessionId: "session:test",

12331286

sessionKey: "agent:test:cooldown-failover",

@@ -1242,12 +1295,12 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

12421295

timeoutMs: 5_000,

12431296

runId: "run:cooldown-failover",

12441297

}),

1245-

).rejects.toMatchObject({

1246-

name: "FailoverError",

1247-

reason: "unknown",

1248-

provider: "openai",

1249-

model: "mock-1",

1250-

});

1298+

{

1299+

reason: "unknown",

1300+

provider: "openai",

1301+

model: "mock-1",

1302+

},

1303+

);

1251130412521305

expect(runEmbeddedAttemptMock).not.toHaveBeenCalled();

12531306

});

@@ -1398,7 +1451,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

13981451

},

13991452

});

140014531401-

await expect(

1454+

await expectFailoverError(

14021455

runEmbeddedPiAgentInline({

14031456

sessionId: "session:test",

14041457

sessionKey: "agent:support:cooldown-failover",

@@ -1414,12 +1467,12 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

14141467

runId: "run:agent-override-fallback",

14151468

agentId: "support",

14161469

}),

1417-

).rejects.toMatchObject({

1418-

name: "FailoverError",

1419-

reason: "unknown",

1420-

provider: "openai",

1421-

model: "mock-1",

1422-

});

1470+

{

1471+

reason: "unknown",

1472+

provider: "openai",

1473+

model: "mock-1",

1474+

},

1475+

);

1423147614241477

expect(runEmbeddedAttemptMock).not.toHaveBeenCalled();

14251478

});

@@ -1443,7 +1496,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

14431496

},

14441497

});

144514981446-

await expect(

1499+

await expectFailoverError(

14471500

runEmbeddedPiAgentInline({

14481501

sessionId: "session:test",

14491502

sessionKey: "agent:test:disabled-failover",

@@ -1458,12 +1511,12 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

14581511

timeoutMs: 5_000,

14591512

runId: "run:disabled-failover",

14601513

}),

1461-

).rejects.toMatchObject({

1462-

name: "FailoverError",

1463-

reason: "billing",

1464-

provider: "openai",

1465-

model: "mock-1",

1466-

});

1514+

{

1515+

reason: "billing",

1516+

provider: "openai",

1517+

model: "mock-1",

1518+

},

1519+

);

1467152014681521

expect(runEmbeddedAttemptMock).not.toHaveBeenCalled();

14691522

});

@@ -1479,7 +1532,7 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

14791532

await fs.writeFile(authPath, JSON.stringify({ version: 1, profiles: {} }));

14801533

await fs.writeFile(authStatePath, JSON.stringify({ version: 1, usageStats: {} }));

148115341482-

await expect(

1535+

await expectFailoverError(

14831536

runEmbeddedPiAgentInline({

14841537

sessionId: "session:test",

14851538

sessionKey: "agent:test:auth-unavailable",

@@ -1494,7 +1547,8 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

14941547

timeoutMs: 5_000,

14951548

runId: "run:auth-unavailable",

14961549

}),

1497-

).rejects.toMatchObject({ name: "FailoverError", reason: "auth" });

1550+

{ reason: "auth" },

1551+

);

1498155214991553

expect(runEmbeddedAttemptMock).not.toHaveBeenCalled();

15001554

});

@@ -1536,13 +1590,11 @@ describe("runEmbeddedPiAgent auth profile rotation", () => {

15361590

} catch (err) {

15371591

thrown = err;

15381592

}

1539-1540-

expect(thrown).toMatchObject({

1541-

name: "FailoverError",

1542-

reason: "billing",

1543-

provider: "openai",

1544-

model: "mock-rotated",

1545-

});

1593+

const errorRecord = requireRecord(thrown, "billing failover error");

1594+

expect(errorRecord.name).toBe("FailoverError");

1595+

expect(errorRecord.reason).toBe("billing");

1596+

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

1597+

expect(errorRecord.model).toBe("mock-rotated");

15461598

expect(thrown).toBeInstanceOf(Error);

15471599

expect((thrown as Error).message).toContain("openai (mock-rotated) returned a billing error");

15481600

expect(runEmbeddedAttemptMock).toHaveBeenCalledTimes(1);