fix(webui): only highlight actual model fallbacks

This commit is contained in:
chengyongru
2026-08-21 16:49:30 +08:00
committed by chengyongru
parent 761e95b659
commit 7f97373490
9 changed files with 26 additions and 2 deletions
+13 -1
View File
@@ -696,7 +696,7 @@ describe("ThreadShell", () => {
expect(screen.queryByRole("button", { name: "Model not configured" })).not.toBeInTheDocument();
});
it("highlights the configured model badge without replacing the preset label", async () => {
it("only highlights fallback model updates without replacing the preset label", async () => {
const client = makeClient();
render(wrap(
client,
@@ -715,11 +715,23 @@ describe("ThreadShell", () => {
expect(configuredBadge).toHaveClass("composer-model-badge");
expect(configuredBadge).not.toHaveAttribute("data-fallback");
act(() => {
client._emitChat("fallback-model", {
event: "turn_model_updated",
chat_id: "fallback-model",
model_name: "openai-codex/gpt-5.5",
is_fallback: false,
});
});
expect(configuredBadge).not.toHaveAttribute("data-fallback");
act(() => {
client._emitChat("fallback-model", {
event: "turn_model_updated",
chat_id: "fallback-model",
model_name: "deepseek/deepseek-chat",
is_fallback: true,
});
});