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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
I
InfoQ
V
Visual Studio Blog
M
MIT News - Artificial intelligence
H
Help Net Security
博客园_首页
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
A
About on SuperTechFans
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
WordPress大学
WordPress大学

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
refactor(agents): remove stale live model switch api · op...
vincentkoc · 2026-06-18 · via Recent Commits to openclaw:main

@@ -2,8 +2,6 @@

22

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

3344

const state = vi.hoisted(() => ({

5-

abortEmbeddedAgentRunMock: vi.fn(),

6-

requestEmbeddedRunModelSwitchMock: vi.fn(),

75

resolveDefaultModelForAgentMock: vi.fn(),

86

resolvePersistedSelectedModelRefMock: vi.fn(),

97

loadSessionStoreMock: vi.fn(),

@@ -17,12 +15,6 @@ vi.mock("./embedded-agent.js", () => {

1715

return {};

1816

});

191720-

vi.mock("./embedded-agent-runner/runs.js", () => ({

21-

abortEmbeddedAgentRun: (...args: unknown[]) => state.abortEmbeddedAgentRunMock(...args),

22-

requestEmbeddedRunModelSwitch: (...args: unknown[]) =>

23-

state.requestEmbeddedRunModelSwitchMock(...args),

24-

}));

25-2618

vi.mock("./model-selection.js", async () => {

2719

const actual =

2820

await vi.importActual<typeof import("./model-selection.js")>("./model-selection.js");

@@ -81,8 +73,6 @@ describe("live model switch", () => {

8173

});

82748375

beforeEach(() => {

84-

state.abortEmbeddedAgentRunMock.mockReset().mockReturnValue(false);

85-

state.requestEmbeddedRunModelSwitchMock.mockReset();

8676

state.embeddedAgentModuleImported = false;

8777

state.resolveDefaultModelForAgentMock

8878

.mockReset()

@@ -339,27 +329,6 @@ describe("live model switch", () => {

339329

});

340330

});

341331342-

it("queues a live switch only when an active run was aborted", async () => {

343-

// Switching live runs is two-phase: abort the active run, then queue the

344-

// selected provider/model for the restarted embedded run to consume.

345-

state.abortEmbeddedAgentRunMock.mockReturnValue(true);

346-347-

const { requestLiveSessionModelSwitch } = await loadModule();

348-349-

expect(

350-

requestLiveSessionModelSwitch({

351-

sessionEntry: { sessionId: "session-1" },

352-

selection: { provider: "openai", model: "gpt-5.4", authProfileId: "profile-gpt" },

353-

}),

354-

).toBe(true);

355-

expect(state.abortEmbeddedAgentRunMock).toHaveBeenCalledWith("session-1");

356-

expect(state.requestEmbeddedRunModelSwitchMock).toHaveBeenCalledWith("session-1", {

357-

provider: "openai",

358-

model: "gpt-5.4",

359-

authProfileId: "profile-gpt",

360-

});

361-

});

362-363332

it("does not import the broad embedded-agent barrel on module load", async () => {

364333

await loadModule();

365334

@@ -435,23 +404,6 @@ describe("live model switch", () => {

435404

).toBe(false);

436405

});

437406438-

it("does not track persisted live selection when the run started on a transient model override", async () => {

439-

const { shouldTrackPersistedLiveSessionModelSelection } = await loadModule();

440-441-

expect(

442-

shouldTrackPersistedLiveSessionModelSelection(

443-

{

444-

provider: "anthropic",

445-

model: "claude-haiku-4-5",

446-

},

447-

{

448-

provider: "anthropic",

449-

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

450-

},

451-

),

452-

).toBe(false);

453-

});

454-455407

describe("shouldSwitchToLiveModel", () => {

456408

it("returns the persisted selection when liveModelSwitchPending is true and model differs", async () => {

457409

const sessionEntry = {