Skip to content

Your lightweight open-source personal agent.

fix(webui): keep composer model badge in sync

Xubin Ren754f457a9483
diff --git a/webui/src/components/thread/ThreadShell.tsx b/webui/src/components/thread/ThreadShell.tsx
index a364f10df..2094929d2 100644
--- a/webui/src/components/thread/ThreadShell.tsx
+++ b/webui/src/components/thread/ThreadShell.tsx
@@ -195,7 +195,7 @@ function toModelBadgeInfo(
const preset = modelPresetForBadge(settings, scopedPreset);
const model = scopedPreset
? preset?.model || null
- : modelName || settings?.agent.model || null;
+ : settings?.agent.model || modelName || null;
const label = toModelBadgeLabel(model);
const rawProvider = preset?.provider
|| (!scopedPreset ? settings?.agent.provider : null)
diff --git a/webui/src/tests/thread-shell.test.tsx b/webui/src/tests/thread-shell.test.tsx
index b7f910aa1..b0d61cc6c 100644
--- a/webui/src/tests/thread-shell.test.tsx
+++ b/webui/src/tests/thread-shell.test.tsx
@@ -369,6 +369,26 @@ describe("ThreadShell", () => {
expect(await screen.findByTestId("composer-model-logo-openai_codex")).toBeInTheDocument();
});
+ it("keeps the composer model name and provider on the same settings snapshot", async () => {
+ const client = makeClient();
+ render(
+ wrap(
+ client,
+ <ThreadShell
+ session={session("model-settings-sync")}
+ title="Model settings sync"
+ onToggleSidebar={() => {}}
+ settingsSnapshot={modelSettings("openai-codex/gpt-5.5", "openai_codex")}
+ />,
+ "ling/ling-3.0-flash",
+ ),
+ );
+
+ expect(await screen.findByTestId("composer-model-logo-openai_codex")).toBeInTheDocument();
+ expect(screen.getByText("gpt-5.5")).toBeInTheDocument();
+ expect(screen.queryByText("ling-3.0-flash")).not.toBeInTheDocument();
+ });
+
it("resolves the composer model from the active session preset", async () => {
const client = makeClient();
render(