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

推荐订阅源

小众软件
小众软件
量子位
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - 【当耐特】
L
LangChain Blog
A
About on SuperTechFans
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
Netflix TechBlog - Medium
博客园_首页
WordPress大学
WordPress大学
博客园 - Franky
Engineering at Meta
Engineering at Meta
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
M
MIT News - Artificial intelligence

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: shortcut live session model redirects during fallbac...
vincentkoc · 2026-04-27 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -7,6 +7,7 @@ Docs: https://docs.openclaw.ai

77

### Fixes

88
99

- Auto-reply: poison inbound message dedupe after replay-unsafe provider/runtime failures so retries stay safe before visible progress but cannot duplicate messages after block output, tool side effects, or session progress. Fixes #69303; keeps #58549 and #64606 as duplicate validation. Thanks @martingarramon, @NikolaFC, and @zeroth-blip.

10+

- Agents/model fallback: jump directly to a known later live-session model redirect instead of walking unrelated fallback candidates, while preserving the already-landed live-session/fallback loop guard. Fixes #57471; related loop family already closed via #58496. Thanks @yuxiaoyang2007-prog.

1011

- Gateway/Bonjour: keep @homebridge/ciao cancellation handlers registered across advertiser restarts so late probing cancellations cannot crash Linux and other mDNS-churned gateways. Thanks @codex.

1112

- Plugins/startup: load the default `memory-core` slot during Gateway startup when permitted so active-memory recall can call `memory_search` and `memory_get` without requiring an explicit `plugins.slots.memory` entry, while preserving `plugins.slots.memory: "none"`. Thanks @codex.

1213

- Plugins/CLI: prefer native require for compiled bundled plugin JavaScript before jiti so read-only config, status, device, and node commands avoid unnecessary transform overhead on slow hosts. Fixes #62842. Thanks @Effet.

Original file line numberDiff line numberDiff line change

@@ -707,6 +707,55 @@ describe("runWithModelFallback", () => {

707707

expect(run).toHaveBeenCalledTimes(2);

708708

});

709709
710+

it("jumps directly to a later live-session model switch candidate (#57471)", async () => {

711+

const cfg = makeCfg({

712+

agents: {

713+

defaults: {

714+

model: {

715+

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

716+

fallbacks: [

717+

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

718+

"anthropic/claude-sonnet-4-6",

719+

"openrouter/deepseek-chat",

720+

],

721+

},

722+

},

723+

},

724+

});

725+

const switchError = new LiveSessionModelSwitchError({

726+

provider: "anthropic",

727+

model: "claude-sonnet-4-6",

728+

});

729+

const run = vi.fn(async (provider: string, model: string) => {

730+

if (provider === "openai" && model === "gpt-4.1-mini") {

731+

throw switchError;

732+

}

733+

if (provider === "anthropic" && model === "claude-sonnet-4-6") {

734+

return "ok";

735+

}

736+

throw new Error(`unexpected fallback candidate: ${provider}/${model}`);

737+

});

738+

const onError = vi.fn();

739+
740+

const result = await runWithModelFallback({

741+

cfg,

742+

provider: "openai",

743+

model: "gpt-4.1-mini",

744+

run,

745+

onError,

746+

});

747+
748+

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

749+

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

750+

expect(result.model).toBe("claude-sonnet-4-6");

751+

expect(result.attempts).toEqual([]);

752+

expect(onError).not.toHaveBeenCalled();

753+

expect(run.mock.calls).toEqual([

754+

["openai", "gpt-4.1-mini"],

755+

["anthropic", "claude-sonnet-4-6"],

756+

]);

757+

});

758+
710759

it("falls back on auth errors", async () => {

711760

await expectFallsBackToHaiku({

712761

provider: "openai",

Original file line numberDiff line numberDiff line change

@@ -326,6 +326,18 @@ function recordFailedCandidateAttempt(params: {

326326

});

327327

}

328328
329+

function findLaterLiveSessionModelSwitchCandidateIndex(params: {

330+

error: LiveSessionModelSwitchError;

331+

candidates: ModelCandidate[];

332+

currentIndex: number;

333+

}): number | null {

334+

const targetKey = modelKey(params.error.provider, params.error.model);

335+

const targetIndex = params.candidates.findIndex(

336+

(candidate) => modelKey(candidate.provider, candidate.model) === targetKey,

337+

);

338+

return targetIndex > params.currentIndex ? targetIndex : null;

339+

}

340+
329341

function throwFallbackFailureSummary(params: {

330342

attempts: FallbackAttempt[];

331343

candidates: ModelCandidate[];

@@ -924,6 +936,16 @@ export async function runWithModelFallback<T>(params: {

924936

// instead of re-throwing and triggering infinite retry loops in the

925937

// outer runner. (#58466)

926938

if (err instanceof LiveSessionModelSwitchError) {

939+

const liveSwitchTargetIndex = findLaterLiveSessionModelSwitchCandidateIndex({

940+

error: err,

941+

candidates,

942+

currentIndex: i,

943+

});

944+

if (liveSwitchTargetIndex !== null) {

945+

i = liveSwitchTargetIndex - 1;

946+

continue;

947+

}

948+
927949

const switchMsg = err.message;

928950

const switchNormalized = new FailoverError(switchMsg, {

929951

reason: "overloaded",