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

推荐订阅源

L
LangChain Blog
J
Java Code Geeks
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
雷峰网
雷峰网
D
DataBreaches.Net
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta

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(ui): keep selected chat model visible after session s...
brokemac79 · 2026-05-31 · via Recent Commits to openclaw:main

@@ -2340,6 +2340,81 @@ describe("chat session controls", () => {

23402340

expect(rerendered.value).toBe("openai/gpt-5-mini");

23412341

});

234223422343+

it("keeps the selected model visible after switching away and back to a session", async () => {

2344+

const sessionA = "agent:main:session-a";

2345+

const sessionB = "agent:main:session-b";

2346+

const catalog = createModelCatalog(...DEFAULT_CHAT_MODEL_CATALOG, {

2347+

id: "claude-opus-4.5",

2348+

name: "Claude Opus 4.5",

2349+

provider: "bedrock",

2350+

});

2351+

const { state } = createChatHeaderState({ models: catalog });

2352+

let rows: GatewaySessionRow[] = [

2353+

{ key: sessionA, kind: "direct", label: "Session A", updatedAt: 2 },

2354+

{ key: sessionB, kind: "direct", label: "Session B", updatedAt: 1 },

2355+

];

2356+

const request = vi.fn(async (method: string, params: Record<string, unknown> = {}) => {

2357+

if (method === "sessions.patch") {

2358+

const key = typeof params.key === "string" ? params.key : "";

2359+

const nextModel = typeof params.model === "string" ? params.model.trim() : "";

2360+

rows = rows.map((row) => {

2361+

if (row.key !== key) {

2362+

return row;

2363+

}

2364+

const nextRow: GatewaySessionRow = { ...row };

2365+

if (!nextModel) {

2366+

delete nextRow.model;

2367+

delete nextRow.modelProvider;

2368+

return nextRow;

2369+

}

2370+

const slashIndex = nextModel.indexOf("/");

2371+

if (slashIndex > 0) {

2372+

nextRow.modelProvider = nextModel.slice(0, slashIndex);

2373+

} else {

2374+

delete nextRow.modelProvider;

2375+

}

2376+

nextRow.model = slashIndex > 0 ? nextModel.slice(slashIndex + 1) : nextModel;

2377+

return nextRow;

2378+

});

2379+

return { ok: true, key };

2380+

}

2381+

if (method === "sessions.list") {

2382+

return createSessionsResultFromRows(rows);

2383+

}

2384+

if (method === "chat.history") {

2385+

return { messages: [] };

2386+

}

2387+

if (method === "tools.effective") {

2388+

return { agentId: "main", profile: "coding", groups: [] };

2389+

}

2390+

throw new Error(`Unexpected request: ${method}`);

2391+

});

2392+

state.client = { request } as unknown as GatewayBrowserClient;

2393+

state.sessionKey = sessionA;

2394+

state.settings.sessionKey = sessionA;

2395+

state.sessionsResult = createSessionsResultFromRows(rows);

2396+

const container = document.createElement("div");

2397+

render(renderChatSessionSelect(state), container);

2398+2399+

const modelSelect = getChatModelSelect(container);

2400+

expect(modelSelect.value).toBe("");

2401+2402+

modelSelect.value = "bedrock/claude-opus-4.5";

2403+

modelSelect.dispatchEvent(new Event("change", { bubbles: true }));

2404+

await flushTasks();

2405+2406+

state.sessionKey = sessionB;

2407+

state.settings.sessionKey = sessionB;

2408+

render(renderChatSessionSelect(state), container);

2409+

expect(getChatModelSelect(container).value).toBe("");

2410+2411+

state.sessionKey = sessionA;

2412+

state.settings.sessionKey = sessionA;

2413+

render(renderChatSessionSelect(state), container);

2414+2415+

expect(getChatModelSelect(container).value).toBe("bedrock/claude-opus-4.5");

2416+

});

2417+23432418

it("uses default thinking options when the active session is absent", () => {

23442419

const { state } = createChatHeaderState({ omitSessionFromList: true });

23452420

state.sessionsResult = createSessionsListResult({