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

推荐订阅源

Martin Fowler
Martin Fowler
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
雷峰网
雷峰网
J
Java Code Geeks
G
Google Developers Blog
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
L
LangChain Blog
人人都是产品经理
人人都是产品经理
GbyAI
GbyAI
Vercel News
Vercel News
S
SegmentFault 最新的问题
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Y
Y Combinator Blog
博客园_首页
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
A
About on SuperTechFans
B
Blog
Microsoft Security Blog
Microsoft Security 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
fix(agents): skip fallback for session coordination error...
luyao618 · 2026-05-18 · via Recent Commits to openclaw:main

@@ -23,6 +23,7 @@ import {

2323

} from "./model-fallback.js";

2424

import { classifyEmbeddedPiRunResultForModelFallback } from "./pi-embedded-runner/result-fallback-classifier.js";

2525

import type { EmbeddedPiRunResult } from "./pi-embedded-runner/types.js";

26+

import { SessionWriteLockTimeoutError } from "./session-write-lock-error.js";

2627

import { makeModelFallbackCfg } from "./test-helpers/model-fallback-config-fixture.js";

27282829

vi.mock("../infra/file-lock.js", () => ({

@@ -768,6 +769,106 @@ describe("runWithModelFallback", () => {

768769

expect(run).toHaveBeenCalledTimes(1);

769770

});

770771772+

it("aborts the fallback chain on embedded session takeover instead of trying every model (#83510)", async () => {

773+

const cfg = makeCfg({

774+

agents: {

775+

defaults: {

776+

model: {

777+

primary: "openai/gpt-5.4",

778+

fallbacks: ["anthropic/claude-sonnet-4-6", "openai/gpt-4.1-mini"],

779+

},

780+

},

781+

},

782+

});

783+

const takeoverError = new Error(

784+

"session file changed while embedded prompt lock was released: /tmp/session.jsonl",

785+

);

786+

takeoverError.name = "EmbeddedAttemptSessionTakeoverError";

787+

const run = vi.fn().mockRejectedValue(takeoverError);

788+789+

await expect(

790+

runWithModelFallback({

791+

cfg,

792+

provider: "openai",

793+

model: "gpt-5.4",

794+

run,

795+

}),

796+

).rejects.toBe(takeoverError);

797+

expect(run).toHaveBeenCalledTimes(1);

798+

});

799+800+

it("aborts the fallback chain on session write-lock timeout instead of trying every model (#83510)", async () => {

801+

const cfg = makeCfg({

802+

agents: {

803+

defaults: {

804+

model: {

805+

primary: "openai/gpt-5.4",

806+

fallbacks: ["anthropic/claude-sonnet-4-6", "openai/gpt-4.1-mini"],

807+

},

808+

},

809+

},

810+

});

811+

const lockError = new SessionWriteLockTimeoutError({

812+

timeoutMs: 10_000,

813+

owner: "pid=37121",

814+

lockPath: "/tmp/openclaw/session.jsonl.lock",

815+

});

816+

const run = vi.fn().mockRejectedValue(lockError);

817+818+

await expect(

819+

runWithModelFallback({

820+

cfg,

821+

provider: "openai",

822+

model: "gpt-5.4",

823+

run,

824+

}),

825+

).rejects.toBe(lockError);

826+

expect(run).toHaveBeenCalledTimes(1);

827+

});

828+829+

it("keeps provider failover metadata authoritative over nested session locks", async () => {

830+

const cfg = makeCfg({

831+

agents: {

832+

defaults: {

833+

model: {

834+

primary: "openai/gpt-5.4",

835+

fallbacks: ["anthropic/claude-sonnet-4-6"],

836+

},

837+

},

838+

},

839+

});

840+

const lockError = new SessionWriteLockTimeoutError({

841+

timeoutMs: 10_000,

842+

owner: "pid=37121",

843+

lockPath: "/tmp/openclaw/session.jsonl.lock",

844+

});

845+

const providerError = {

846+

status: 429,

847+

code: "RESOURCE_EXHAUSTED",

848+

message: "upstream quota pressure",

849+

cause: lockError,

850+

};

851+

const run = vi.fn().mockRejectedValueOnce(providerError).mockResolvedValueOnce("fallback ok");

852+853+

const result = await runWithModelFallback({

854+

cfg,

855+

provider: "openai",

856+

model: "gpt-5.4",

857+

run,

858+

});

859+860+

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

861+

expect(result.provider).toBe("anthropic");

862+

expect(run).toHaveBeenCalledTimes(2);

863+

expect(result.attempts[0]).toMatchObject({

864+

provider: "openai",

865+

model: "gpt-5.4",

866+

reason: "rate_limit",

867+

status: 429,

868+

code: "RESOURCE_EXHAUSTED",

869+

});

870+

});

871+771872

it("keeps raw provider schema errors in fallback summaries", async () => {

772873

const cfg = makeCfg({

773874

agents: {