Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Model picker: a pick in a thread changes only that thread

milind-soni26032f8077ea
diff --git a/docs/verification/bot-continuity.md b/docs/verification/bot-continuity.md
index 65b78e39a9..c1ac1ce2c3 100644
--- a/docs/verification/bot-continuity.md
+++ b/docs/verification/bot-continuity.md
@@ -25,18 +25,18 @@ turns, and checks the prompt and model delivered to the provider boundary:
The test prints a retained `.bot-continuity.json` evidence path with commands,
wait results, bounded transcripts, and provider-input receipts. Launch
-environments and MCP tokens are not retained. The renderer recipe checks both
-scope buttons in the real model picker, saves a screenshot, changes models,
-checks server persistence, and sends a message through the composer.
-
-The header starts at **Only this thread**; **Thread + bot default** explicitly
-includes group turns and future threads. The desktop model-switch recipe uses
-the real picker and private approval channel against offline providers. It
-checks Cancel, the 390px confirmation layout, switching a Custom Codex thread
-to Claude with Ask in one confirmed operation, then updating a mismatched bot
-default without changing another existing Custom thread. HTTP cannot bypass
+environments and MCP tokens are not retained. The renderer recipe checks the
+real model picker, saves a screenshot, changes models, checks server
+persistence, and sends a message through the composer.
+
+A pick in a thread changes only that thread, and the next new thread starts on
+it; the bot's own model, used by groups, changes from its settings. The desktop
+model-switch recipe uses the real picker and private approval channel against
+offline providers. It checks Cancel, the 390px confirmation layout, and
+switching a Custom Codex thread to Claude with Ask in one confirmed operation
+without changing the bot or another existing Custom thread. HTTP cannot bypass
Custom; ordinary Full switches may use the atomic HTTP downgrade. A fresh
-thread adopts the new default, and a sample engineering-handoff request sent
+thread starts on the picked model at Ask, and a sample engineering-handoff request sent
through the composer completes with the fake provider reply. Screenshots stay
in `.omb-scratch/verify-evidence/model-switch/`. This proves settings and turn
dispatch, not the quality of a real model's engineering output. The store test
diff --git a/docs/verification/threads.md b/docs/verification/threads.md
index 4116eb91e9..4095778d27 100644
--- a/docs/verification/threads.md
+++ b/docs/verification/threads.md
@@ -19,10 +19,10 @@ switching and Stop can be exercised without a real provider or account.
rows should show Working. Changing the selection must not move messages.
3. Stop iCloud. Gmail must remain Working; its Stop control still targets Gmail.
4. In an idle thread, change its model. Select a sibling and return; each
- should retain its own choice. The model picker defaults to **This bot**:
- it updates the visible thread plus the default for groups and new threads,
- not existing siblings. Choose **Only this thread** for an independent
- model/account/effort override. Approval controls remain thread-scoped.
+ should retain its own choice. A pick changes only the visible thread; the
+ next new thread starts on it, and existing siblings keep theirs. The bot's
+ own model, used by groups, changes from its settings. Approval controls
+ remain thread-scoped.
5. Rename a thread through its row menu. Remove the Email folder through its
settings and confirm **Delete folder, keep threads**. Histories and model
selections must remain, now directly beneath Pepper.
diff --git a/packages/phone-protocol/src/wire.ts b/packages/phone-protocol/src/wire.ts
index 5614e2f9ea..d8aea418b8 100644
--- a/packages/phone-protocol/src/wire.ts
+++ b/packages/phone-protocol/src/wire.ts
@@ -299,9 +299,9 @@ export interface WireBot extends DefaultBotFields, BotAccessFields {
avatarFocusY?: number;
/** True when any task has unread output. */
unread: boolean;
- /** The bot's model: every thread without a model of its own runs on it
- * and moves with it. Navigating tasks never changes this value. */
+ /** The bot's model: every thread without a model of its own runs on it and moves with it. Navigating tasks never changes this value. */
modelSelection: ModelSelection;
+ /** A new thread starts on this, not modelSelection: its owner's latest pick in a thread, until they pick the bot's model. */ newThreadModel?: ModelSelection;
/** where the bot works ("Works on"). Unset = auto. */
computer?: Surface | "off";
/** Which cloud computer backs computer: "cloud"; absent means Boat. */
diff --git a/scripts/testing/control-omb-ui.e2e.test.ts b/scripts/testing/control-omb-ui.e2e.test.ts
index 7b31058ea7..f2178436e4 100644
--- a/scripts/testing/control-omb-ui.e2e.test.ts
+++ b/scripts/testing/control-omb-ui.e2e.test.ts
@@ -266,27 +266,24 @@ describe("control-omb ui drives the real renderer", () => {
const originalLabel = options.find((option: any) => option.id === originalModel).label;
// A model the installed CLI is too old for is listed but cannot be picked.
const nextModel = options.find((option: any) => option.id !== originalModel && !option.needsCliUpdate);
- // The picker sets the bot's model, which every chat of it uses.
+ // The picker sets this chat's model only; the bot's own model stays for its other chats.
const threadModel = async () => (await savedBot()).tasks.find((task: any) => task.threadId === originalBot.threadId).modelSelection.model;
await ui("click", info.ui, "--name", originalLabel);
- await expect.poll(async () => (await ui("snapshot", info.ui)).snapshot, { timeout: 10_000 }).toContain("Pepper's model, used in all its chats");
+ await expect.poll(async () => (await ui("snapshot", info.ui)).snapshot, { timeout: 10_000 }).toContain("Pepper's model");
mkdirSync(evidenceDir, { recursive: true });
await ui("screenshot", info.ui, "--out", join(evidenceDir, "model-picker.png"));
await ui("click", info.ui, "--name", nextModel.label);
- await expect.poll(async () => (await savedBot()).modelSelection.model, { timeout: 10_000 }).toBe(nextModel.id);
- expect(await threadModel()).toBe(nextModel.id);
+ await expect.poll(threadModel, { timeout: 10_000 }).toBe(nextModel.id);
+ expect((await savedBot()).modelSelection.model).toBe(originalModel);
// A model with reasoning levels keeps the menu open after the pick, so its level can be set next.
expect(await ui("eval", info.ui, "--js", "String(Boolean(document.querySelector('[data-model-picker-content]')))"))
.toMatchObject({ result: "true" });
- const modelSnapshot = await ui("snapshot", info.ui, "--interactive");
- const [originalRow] = refsNamed(modelSnapshot, originalLabel, "button");
- expect(originalRow).toBeDefined();
- await ui("click", info.ui, "--ref", originalRow);
- await expect.poll(async () => (await savedBot()).modelSelection.model, { timeout: 10_000 }).toBe(originalModel);
- expect(await threadModel()).toBe(originalModel);
+ const followBot = "(() => { const row = document.querySelector('[data-follow-bot-model]'); row?.click(); return String(Boolean(row)); })()";
+ expect(await ui("eval", info.ui, "--js", followBot)).toMatchObject({ result: "true" });
+ await expect.poll(threadModel, { timeout: 10_000 }).toBe(originalModel);
+ expect((await savedBot()).modelSelection.model).toBe(originalModel);
+ expect((await savedBot()).newThreadModel).toBeUndefined();
expect((await savedBot()).approvalMode).toBe(originalBot.approvalMode);
- // The menu is still open after that pick; close it before using the composer.
- await ui("press", info.ui, "--keys", "Escape");
await expect.poll(async () => (await ui("eval", info.ui, "--js", "String(Boolean(document.querySelector('[data-model-picker-content]')))")).result,
{ timeout: 10_000 }).toBe("false");
diff --git a/scripts/testing/model-switch-ui-smoke.cjs b/scripts/testing/model-switch-ui-smoke.cjs
index b5336b393b..3ac256d0b4 100644
--- a/scripts/testing/model-switch-ui-smoke.cjs
+++ b/scripts/testing/model-switch-ui-smoke.cjs
@@ -51,7 +51,7 @@ module.exports = async function verifyModelSwitch({ root, url, api, until, grant
assert.notEqual(instances.find(instance => instance.instanceId === "missing-codex").snapshot.state, "available");
assert.equal(await evaluate("!!document.querySelector('[data-model-picker-content] button[aria-label=\"Missing provider fixture\"]')"), false);
assert.ok((await text()).includes("Engines and accounts"));
- assert.equal(await evaluate("[...document.querySelectorAll('[aria-label=\"Apply model changes to\"] button')].find(b => b.textContent === 'Only this thread').getAttribute('aria-pressed')"), "true");
+ assert.equal(await evaluate("!document.querySelector('[aria-label=\"Apply model changes to\"]')"), true);
await click("Claude");
await until(() => evaluate("!!document.querySelector('[data-model-picker-content] select option[value=claude]')"));
// A signed-out account stays in the picker and offers its sign-in card,
@@ -109,20 +109,13 @@ module.exports = async function verifyModelSwitch({ root, url, api, until, grant
assert.equal(threadOnly.tasks.find(task => task.threadId === sibling.threadId).approvalMode, "custom");
assert.deepEqual(calls[0], { threadId: selected.threadId, modelSelection: selection, updateBotDefault: false });
window.setSize(1100, 850);
- await openPicker();
- await click("Thread + bot default");
- await selectClaude();
- assert.ok((await text()).includes("Groups and new threads use this default"));
- writeFileSync(join(evidence, "default-confirmation.png"), (await window.webContents.capturePage()).toPNG());
- await click("Switch with Ask");
- await until(async () => (await read()).modelSelection.instanceId === "claude");
- const after = await read();
- assert.equal(after.approvalMode, "ask");
- assert.equal(after.tasks.find(task => task.threadId === sibling.threadId).approvalMode, "custom");
- assert.equal(calls[1].updateBotDefault, true);
- const newThread = (await api(`/api/bots/${bot.id}/tasks`, "POST", { title: "Uses the new default" })).body.task;
+ const newThread = (await api(`/api/bots/${bot.id}/tasks`, "POST", { title: "Starts on the last pick" })).body.task;
assert.equal(newThread.modelSelection.instanceId, "claude");
assert.equal(newThread.approvalMode, "ask");
+ const after = await read();
+ assert.equal(after.modelSelection.instanceId, "codex");
+ assert.equal(after.approvalMode, "custom");
+ assert.equal(after.tasks.find(task => task.threadId === sibling.threadId).approvalMode, "custom");
await api(`/api/bots/${bot.id}/tasks/${selected.threadId}`, "POST", {});
await until(async () => (await read()).threadId === selected.threadId);
// Send a work request through the real composer after both transitions.
diff --git a/server/bot-projects-api.test.ts b/server/bot-projects-api.test.ts
index e5952ce172..bcd36986d2 100644
--- a/server/bot-projects-api.test.ts
+++ b/server/bot-projects-api.test.ts
@@ -76,7 +76,7 @@ describe("organizational folders through an isolated HTTP fixture", () => {
expect(ungrouped.body.bot.projects).toEqual([{ id: projectId, name: "Site", emoji: "🖥️" }]);
expect(ungrouped.body.bot.messages.some((message: any) => message.text === "Keep this project's conversation")).toBe(true);
const next = (await api("POST", `/api/bots/${bot.id}/tasks`, { title: "Next task", projectId })).body.task;
- expect(next.modelSelection).toEqual(selection(models[0]));
+ expect(next.modelSelection).toEqual(selection(models[1]));
expect(next.cwd).toBeUndefined();
expect((await api("PATCH", `/api/bots/${bot.id}/projects/${projectId}`, { modelSelection: null })).status).toBe(400);
expect((await api("POST", `/api/bots/${bot.id}/interrupt`, { threadId: first.threadId })).status).toBe(200);
diff --git a/server/index.ts b/server/index.ts
index 31b6a69fc6..70a6985afc 100644
--- a/server/index.ts
+++ b/server/index.ts
@@ -3387,7 +3387,7 @@ function handleDesktopTrustedApprovalMessage(raw: unknown): boolean {
if (!checked.ok) { respond({ ok: false, error: checked.error }); return true; }
try {
store.switchTaskModel(botId, threadId as string, checked.selection, message.updateBotDefault, true,
- hostedModels?.resetTask(target.modelSelection, checked.selection));
+ hostedModels?.resetTask(target.modelSelection, checked.selection), true);
const fresh = { ...wireBot(store.bot(botId)!), approvalMode: approvalModeFor(store.bot(botId)!) };
broadcast({ kind: "bot", bot: fresh });
respond({ ok: true, bot: fresh });
@@ -12088,7 +12088,7 @@ const taskRoutes = createTaskRoutes({
cloudThreadRefusal,
sharedWorkspaceFullAccessEnabled,
supportsApprovalMode,
- threadBusy, broadcast, notificationListed,
+ threadBusy, broadcast, notificationListed, newThreadLevel: (bot, selection) => ownThreads.levelFor(bot, selection),
publicBot,
wireBot,
wireTask,
diff --git a/server/routes/tasks.ts b/server/routes/tasks.ts
index 9d144f29c5..a36a3e12ad 100644
--- a/server/routes/tasks.ts
+++ b/server/routes/tasks.ts
@@ -12,6 +12,7 @@ import type { RoutineManager } from "../routines.ts";
import type { SkillReview } from "../skill-review.ts";
import type { ThreadTitleGate } from "../host/thread-titles.ts";
import { isProjectEmoji, type BotRecord, type Store, type TaskRecord } from "../store.ts";
+import type { NewThreadLevel } from "../task-record.ts";
import { parseSurface } from "../surface.ts";
import type { ThreadStarters } from "../thread-starters.ts";
import { titleConversationExcerpt, type ThreadTitleSource } from "../thread-title.ts";
@@ -76,6 +77,8 @@ export interface TaskRouteDeps {
rejectDeletedThreadSkillStages(cleanups: Array<{ botId: string; stagedId: string }>): void;
/** A person opened this conversation (a Team Cloud's Needs you lines for them there are done). */
threadRead?(auth: RequestAuth, threadId: string): void;
+ /** "ask" when a new thread of `bot` on `selection` must start at Ask: its engine does not carry the bot's level. */
+ newThreadLevel(bot: BotRecord, selection: ModelSelection): NewThreadLevel | undefined;
/** A conversation's model changed (host/no-terminal.ts); `routinesFollow`: the bot's own model changed with it. */
modelSwitched?(botId: string, threadId: string, before: ModelSelection, after: ModelSelection, routinesFollow: boolean): void;
}
@@ -215,8 +218,10 @@ export function createTaskRoutes(deps: TaskRouteDeps): RouteHandler & { deleteTa
if (body.projectId !== undefined && (typeof body.projectId !== "string" || !store.project(bot.id, body.projectId))) {
return json(res, 400, { error: "projectId must belong to this bot" });
}
+ const startsOn = bot.newThreadModel && checkedModelSelection(bot.newThreadModel).ok ? bot.newThreadModel : undefined;
+ const level = startsOn && deps.newThreadLevel(bot, startsOn) === "ask" ? "ask" : body.approvalMode;
// Who opened it decides who may answer its cards on a shared workspace, and on a team who sees it at all.
- const task = store.createTask(bot.id, typeof body.title === "string" ? body.title : undefined, body.select !== false, body.projectId, undefined, body.approvalMode, undefined, cwd,
+ const task = store.createTask(bot.id, typeof body.title === "string" ? body.title : undefined, body.select !== false, body.projectId, undefined, level, startsOn, cwd,
auth.kind === "session" ? (created) => threadStarters.set(created.threadId, actorKey(auth)) : undefined);
if (!task) return json(res, 500, { error: "couldn't create that task" });
madeThread(bot.id, task.threadId);
@@ -279,6 +284,7 @@ export function createTaskRoutes(deps: TaskRouteDeps): RouteHandler & { deleteTa
(body.approvalMode !== undefined || body.autoApprove !== undefined || body.acknowledgeLocalAuto !== undefined || body.updateBotDefault === true || body.refreshPermissions === true)) {
return json(res, 403, { error: "On this Cloud only its owner can change how a bot asks for approval, or its default model." });
}
+ const ownsBotModel = ownerOrAdmin(auth) && (!CLOUD_HOME || cloudOwnerSession(auth));
if (body.updateBotDefault === true && !ownerOrAdmin(auth)) {
return json(res, 403, userError("serverError.model.defaultAdmin"));
}
@@ -409,7 +415,7 @@ export function createTaskRoutes(deps: TaskRouteDeps): RouteHandler & { deleteTa
}
const task = patch.modelSelection
? store.switchTaskModel(m[1], m[2], patch.modelSelection, body.updateBotDefault === true, body.resetApprovalToAsk === true,
- { ...patch, ...hostedModels?.resetTask(current.modelSelection, patch.modelSelection) })!
+ { ...patch, ...hostedModels?.resetTask(current.modelSelection, patch.modelSelection) }, ownsBotModel)!
: store.patchTask(m[1], m[2], patch)!;
if (patch.modelSelection) deps.modelSwitched?.(m[1], m[2], current.modelSelection, patch.modelSelection, body.updateBotDefault === true);
return json(res, 200, { task: wireTask(task, store.bot(m[1])!.modelSelection), bot: publicBot(store.bot(m[1])!) } satisfies TaskResponse);
diff --git a/server/store.test.ts b/server/store.test.ts
index 7d0e1c881d..141fed1aa0 100644
--- a/server/store.test.ts
+++ b/server/store.test.ts
@@ -584,6 +584,36 @@ describe("Store", () => {
expect(reloaded.taskByThread(bot.id, picked.threadId)).toMatchObject({ modelSelection: opus, approvalMode: "full" });
});
+ it("remembers an owner's thread pick for new threads in the same save, until the bot's model is picked or its engine goes", () => {
+ const store = new Store(selection);
+ const bot = store.createBot();
+ const first = store.activeTask(bot.id)!;
+ const follower = store.createTask(bot.id)!;
+ const opus = { instanceId: "claude", model: "claude-opus-5" };
+ const save = vi.spyOn(store as unknown as { saveBots(bots: BotRecord[]): void }, "saveBots");
+ store.switchTaskModel(bot.id, first.threadId, opus, false, false, {}, true);
+ expect(save).toHaveBeenCalledTimes(1);
+ expect(bot).toMatchObject({ modelSelection: selection(), newThreadModel: opus });
+ expect(follower.modelSelection).toBeUndefined();
+ expect(new Store(selection).bot(bot.id)?.newThreadModel).toEqual(opus);
+ store.switchTaskModel(bot.id, follower.threadId, { ...opus, model: "claude-haiku-4-5" }, false, false);
+ expect(bot.newThreadModel).toEqual(opus);
+ store.switchTaskModel(bot.id, follower.threadId, selection(), false, false, {}, true);
+ expect(bot.newThreadModel).toBeUndefined();
+ store.switchTaskModel(bot.id, first.threadId, opus, false, false, {}, true);
+ store.patchBot(bot.id, { modelSelection: { ...opus, model: "claude-haiku-4-5" } });
+ expect(bot.newThreadModel).toBeUndefined();
+ store.switchTaskModel(bot.id, first.threadId, opus, false, false, {}, true);
+ store.switchTaskModel(bot.id, first.threadId, opus, true, false, {}, true);
+ expect(store.bot(bot.id)).toMatchObject({ modelSelection: opus });
+ expect(store.bot(bot.id)?.newThreadModel).toBeUndefined();
+ store.switchTaskModel(bot.id, follower.threadId, { instanceId: "spare", model: "claude-opus-5" }, false, false, {}, true);
+ store.renameInstances(new Map([["spare", "spare-2"]]));
+ expect(store.bot(bot.id)?.newThreadModel).toEqual({ instanceId: "spare-2", model: "claude-opus-5" });
+ store.retireInstances(new Set(["spare-2"]), opus, { canWorkOnCloud: false, keepCloud: () => false });
+ expect(store.bot(bot.id)?.newThreadModel).toBeUndefined();
+ });
+
it("createBot seeds a greeting without promising engine-specific tools", () => {
const store = new Store(selection, undefined, undefined, "en");
const bot = store.createBot();
diff --git a/server/store.ts b/server/store.ts
index f62f3318cd..f02b64a718 100644
--- a/server/store.ts
+++ b/server/store.ts
@@ -1348,7 +1348,7 @@ export class Store {
if (at < 0) throw new Error("A setup target no longer exists");
const previous = nextBots[at];
next = { ...previous, ...reshowWhenMoved(previous, operation.fields) };
- if (operation.fields.modelSelection) next.tasks = this.withDefaultModel(previous, operation.fields.modelSelection);
+ if (operation.fields.modelSelection) { next.tasks = this.withDefaultModel(previous, operation.fields.modelSelection); delete next.newThreadModel; }
nextBots[at] = next;
}
if (operation.fields.chiefOfStaff === false) delete next.managedSections; if (!Array.isArray(next.mcpServers)) delete next.mcpServers; // Undo's "every enabled server"
@@ -1398,7 +1398,7 @@ export class Store {
applyModelDefault(id: string, modelSelection: ModelSelection): BotRecord | null {
const previous = this.own(id);
if (!previous) return null;
- const next: BotRecord = { ...previous, modelSelection: structuredClone(modelSelection), tasks: this.withDefaultModel(previous, modelSelection) };
+ const next: BotRecord = { ...previous, modelSelection: structuredClone(modelSelection), newThreadModel: undefined, tasks: this.withDefaultModel(previous, modelSelection) };
this.saveBots(this.bots.map((candidate) => candidate.id === id ? next : candidate));
this.bots = this.bots.map((candidate) => candidate.id === id ? next : candidate);
this.emit({ type: "bot", botId: id });
@@ -1453,7 +1453,7 @@ export class Store {
/** A bot's saved main thread, after saving the one `keep` names for it: no save of its own, it goes with the bot's next one. */ keepMainThread(id: string, keep: (chosen?: string) => string | undefined): string | undefined { const saved = (record?: BotRecord | null) => (record?.mainThreadKept?.id && record.mainThreadKept.under === record.mainThreadChoice ? record.mainThreadKept.id : record?.mainThreadChoice), bot = this.own(id); if (bot?.mainThreadKept && bot.mainThreadKept.under !== bot.mainThreadChoice) { delete bot.mainThreadKept; saveRegistryFor("bots.json", "a main thread saved under an older choice", () => this.saveBotThread(id, undefined, "pass")); } const next = bot && keep(saved(bot)); if (!bot || !next) return saved(this.bot(id)); this.registry.changedInPlace({ kind: "bot", id }); bot.mainThreadKept = { id: next, under: bot.mainThreadChoice }; return next; }
patchBot(id: string, patch: Partial<BotRecord>): BotRecord | null {
const bot = this.own(id);
- if (!bot) return null; patch = reshowWhenMoved(bot, patch);
+ if (!bot) return null; patch = reshowWhenMoved(bot, patch); if (patch.modelSelection) patch = { ...patch, newThreadModel: undefined };
if (patch.connectorTools !== undefined) {
const parsed = parseConnectorTools(patch.connectorTools);
if (!parsed.ok) throw new Error(parsed.error);
@@ -1670,7 +1670,7 @@ export class Store {
for (const bot of this.bots) {
let dirty = false;
const selected = ids.get(bot.modelSelection.instanceId);
- if (selected) { bot.modelSelection = { ...bot.modelSelection, instanceId: selected }; dirty = true; }
+ if (selected) { bot.modelSelection = { ...bot.modelSelection, instanceId: selected }; dirty = true; } const startsOn = bot.newThreadModel && ids.get(bot.newThreadModel.instanceId); if (startsOn) { bot.newThreadModel = { ...bot.newThreadModel!, instanceId: startsOn }; dirty = true; }
if (touches(bot.resumeCursors)) { bot.resumeCursors = rename(bot.resumeCursors); dirty = true; }
for (const task of bot.tasks ?? []) {
const taskSelected = task.modelSelection && ids.get(task.modelSelection.instanceId);
@@ -1716,7 +1716,7 @@ export class Store {
const kept = bot.fallback.filter(candidate => !retired(candidate));
patch.fallback = kept.length ? kept : undefined;
}
- if (touches(bot.resumeCursors)) patch.resumeCursors = without(bot.resumeCursors);
+ if (touches(bot.resumeCursors)) patch.resumeCursors = without(bot.resumeCursors); if (retired(bot.newThreadModel)) patch.newThreadModel = undefined;
const computer = patch.computer ?? bot.computer;
const cloudAfterMove = (pin: TaskRecord["surface"], pinSource: TaskRecord["surfaceSource"]): Pick<ComputerEngineMove, "cloud" | "noComputer"> => {
const place = pin ?? bot.computer;
@@ -2043,11 +2043,10 @@ export class Store {
return stale.length;
}
- /** One write: never publish a new provider before its approval downgrade. */
+ /** One write: never publish a new provider before its approval downgrade. `picked`: an owner's pick, which new threads start on. */
switchTaskModel(botId: string, threadId: string, selection: ModelSelection,
- updateBotDefault: boolean, resetApprovalToAsk: boolean, taskPatch: TaskPatch = {}): TaskRecord | null {
- const bot = this.own(botId);
- const task = this.taskByThread(botId, threadId);
+ updateBotDefault: boolean, resetApprovalToAsk: boolean, taskPatch: TaskPatch = {}, picked = false): TaskRecord | null {
+ const bot = this.own(botId), task = this.taskByThread(botId, threadId);
if (!bot || !task) return null;
const approval = resetApprovalToAsk ? structuredClone(ASK_NOW) : {};
const own = sameModelSelection(selection, updateBotDefault ? selection : bot.modelSelection) ? undefined : structuredClone(selection);
@@ -2055,7 +2054,8 @@ export class Store {
...(typeof taskPatch.title === "string" ? { title: taskPatch.title.trim().slice(0, 80) || UNTITLED_THREAD, titleMode: taskPatch.titleMode ?? "manual" } : {}) });
const others = updateBotDefault ? this.withDefaultModel(bot, selection)! : bot.tasks!;
const nextTasks = bot.tasks!.map((candidate, index) => candidate === task ? nextTask : others[index]!);
- const botPatch = updateBotDefault ? { modelSelection: structuredClone(selection), ...approval } : {};
+ const botPatch = updateBotDefault ? { modelSelection: structuredClone(selection), newThreadModel: undefined, ...approval }
+ : picked ? { newThreadModel: sameModelSelection(selection, bot.modelSelection) ? undefined : structuredClone(selection) } : {};
this.saveBots(this.bots.map((candidate) => candidate === bot ? { ...bot, ...botPatch, tasks: nextTasks } : candidate)); if (taskPatch.title !== undefined) this.taskTitleChanges.set(task, Symbol());
bot.tasks!.forEach((candidate, index) => Object.assign(candidate, nextTasks[index]));
Object.assign(bot, botPatch);
diff --git a/server/thread-aware-bots.e2e.test.ts b/server/thread-aware-bots.e2e.test.ts
index 8cf9d72bfb..105ca0eccf 100644
--- a/server/thread-aware-bots.e2e.test.ts
+++ b/server/thread-aware-bots.e2e.test.ts
@@ -384,7 +384,7 @@ describe("start_thread on yourself", () => {
await expect.poll(async () => (await botState(pm.id))?.busy, { timeout: 15_000 }).toBe(false);
const fresh = await api("POST", `/api/bots/${pm.id}/tasks`, { title: "From scratch" });
- expect(fresh.body.task).toMatchObject({ modelSelection: sonnet, approvalMode: "edits" });
+ expect(fresh.body.task).toMatchObject({ modelSelection: opus, followsBotModel: false, approvalMode: "edits" });
const retired = { instanceId: "retired", model: "old-model" };
expect((await api("PATCH", `/api/bots/${pm.id}/tasks/${fresh.body.task.threadId}`,
{ modelSelection: retired, resetApprovalToAsk: true })).status).toBe(200);
diff --git a/server/thread-only-model-pick.e2e.test.ts b/server/thread-only-model-pick.e2e.test.ts
new file mode 100644
index 0000000000..08cec25f10
--- /dev/null
+++ b/server/thread-only-model-pick.e2e.test.ts
@@ -0,0 +1,108 @@
+import { afterAll, beforeAll, expect, it } from "vitest";
+import { launchVerificationServer, runControlOmb, type VerificationServer } from "../scripts/control-omb.ts";
+
+const sonnet = { instanceId: "claude", model: "claude-sonnet-5" };
+const opus = { instanceId: "claude", model: "claude-opus-5" };
+const haiku = { instanceId: "claude", model: "claude-haiku-4-5" };
+let session: VerificationServer;
+
+beforeAll(async () => {
+ session = await launchVerificationServer(process.env, undefined, undefined, undefined, undefined, undefined, ["kimi"]);
+}, 60_000);
+afterAll(async () => { await session?.close(); });
+
+async function api(method: string, path: string, body?: unknown, token?: string) {
+ const response = await fetch(session.info.url + path, {
+ method, headers: { "content-type": "application/json", ...(token ? { authorization: `Bearer ${token}` } : { origin: session.info.url }) },
+ ...(body === undefined ? {} : { body: JSON.stringify(body) }), signal: AbortSignal.timeout(30_000),
+ });
+ return { status: response.status, body: await response.json() as any };
+}
+
+async function ok(method: string, path: string, body?: unknown) {
+ const result = await api(method, path, body);
+ expect(result.status, `${method} ${path}: ${JSON.stringify(result.body)}`).toBeLessThan(300);
+ return result.body;
+}
+
+async function newBot(name: string) {
+ const { bot } = await runControlOmb(["new-bot", "--name", name, "--url", session.info.url]) as { bot: { id: string } };
+ await ok("PATCH", `/api/bots/${bot.id}/tasks/${(await profile(bot.id)).threadId}`, { modelSelection: sonnet, updateBotDefault: true });
+ return bot.id;
+}
+const profile = async (botId: string) => (await ok("GET", "/api/bots")).bots.find((bot: any) => bot.id === botId);
+const thread = async (botId: string, threadId: string) => (await profile(botId)).tasks.find((task: any) => task.threadId === threadId);
+const newThread = async (botId: string, title: string) => (await ok("POST", `/api/bots/${botId}/tasks`, { title, select: false })).task.threadId as string;
+
+it("keeps a pick in a thread to that thread, starts new threads on it, and lets a thread go back to the bot's model", async () => {
+ const botId = await newBot("Pick keeper");
+ const a = await newThread(botId, "A");
+ const b = await newThread(botId, "B");
+
+ await ok("PATCH", `/api/bots/${botId}/tasks/${a}`, { modelSelection: opus });
+ expect(await thread(botId, a)).toMatchObject({ modelSelection: opus, followsBotModel: false });
+ expect(await thread(botId, b)).toMatchObject({ modelSelection: sonnet, followsBotModel: true });
+ expect(await profile(botId)).toMatchObject({ modelSelection: sonnet, newThreadModel: opus });
+
+ const c = await newThread(botId, "C");
+ expect(await thread(botId, c)).toMatchObject({ modelSelection: opus, followsBotModel: false });
+ expect(await thread(botId, b)).toMatchObject({ modelSelection: sonnet, followsBotModel: true });
+
+ // A reasoning pick is a pick too.
+ await ok("PATCH", `/api/bots/${botId}/tasks/${c}`, { modelSelection: { ...opus, effort: "high" } });
+ expect((await profile(botId)).newThreadModel).toEqual({ ...opus, effort: "high" });
+ expect(await thread(botId, a)).toMatchObject({ modelSelection: opus });
+
+ // "Use the bot's model": the thread follows again, and so do new threads.
+ await ok("PATCH", `/api/bots/${botId}/tasks/${c}`, { modelSelection: sonnet });
+ expect(await thread(botId, c)).toMatchObject({ modelSelection: sonnet, followsBotModel: true });
+ expect((await profile(botId)).newThreadModel).toBeUndefined();
+ const d = await newThread(botId, "D");
+ expect(await thread(botId, d)).toMatchObject({ modelSelection: sonnet, followsBotModel: true });
+}, 60_000);
+
+it("changes the bot's model, and every thread that follows it, only from the bot itself", async () => {
+ const botId = await newBot("Bot-wide");
+ const main = (await profile(botId)).threadId as string;
+ const pinned = await newThread(botId, "Pinned");
+ const follows = await newThread(botId, "Follows");
+ await ok("PATCH", `/api/bots/${botId}/tasks/${pinned}`, { modelSelection: opus });
+ expect((await profile(botId)).newThreadModel).toEqual(opus);
+
+ await ok("PATCH", `/api/bots/${botId}/tasks/${main}`, { modelSelection: haiku, updateBotDefault: true });
+ expect(await profile(botId)).toMatchObject({ modelSelection: haiku });
+ expect((await profile(botId)).newThreadModel).toBeUndefined();
+ expect(await thread(botId, follows)).toMatchObject({ modelSelection: haiku, followsBotModel: true });
+ expect(await thread(botId, pinned)).toMatchObject({ modelSelection: opus, followsBotModel: false });
+ expect(await thread(botId, await newThread(botId, "After"))).toMatchObject({ modelSelection: haiku, followsBotModel: true });
+
+ await ok("PATCH", `/api/bots/${botId}/tasks/${pinned}`, { modelSelection: sonnet });
+ await ok("PATCH", `/api/bots/${botId}`, { modelSelection: opus });
+ expect((await profile(botId)).newThreadModel).toBeUndefined();
+ expect(await thread(botId, await newThread(botId, "After settings"))).toMatchObject({ modelSelection: opus, followsBotModel: true });
+}, 60_000);
+
+it("never lets a chat-only session move where new threads start", async () => {
+ const botId = await newBot("Shared");
+ const threadId = (await profile(botId)).threadId as string;
+ const code = (await ok("POST", "/api/auth/pairing", { scopes: ["client"] })).code;
+ const token = (await ok("POST", "/api/auth/pair", { code })).token as string;
+ const picked = await api("PATCH", `/api/bots/${botId}/tasks/${threadId}`, { modelSelection: opus }, token);
+ expect(picked.status, JSON.stringify(picked.body)).toBe(200);
+ expect(await thread(botId, threadId)).toMatchObject({ modelSelection: opus, followsBotModel: false });
+ expect((await profile(botId)).newThreadModel).toBeUndefined();
+ expect(await thread(botId, await newThread(botId, "Owner's next"))).toMatchObject({ modelSelection: sonnet, followsBotModel: true });
+}, 60_000);
+
+it("starts a new thread on a picked engine its bot's level does not carry to at Ask", async () => {
+ const botId = await newBot("Level keeper");
+ const threadId = (await profile(botId)).threadId as string;
+ await ok("PATCH", `/api/bots/${botId}`, { approvalMode: "edits" });
+ expect((await profile(botId)).approvalMode).toBe("edits");
+ const kimi = { instanceId: "kimi", model: (await ok("GET", "/api/instances")).instances.find((entry: any) => entry.instanceId === "kimi").models.default };
+ await ok("PATCH", `/api/bots/${botId}/tasks/${threadId}`, { modelSelection: kimi, resetApprovalToAsk: true });
+ expect((await profile(botId)).newThreadModel).toEqual(kimi);
+ const started = await thread(botId, await newThread(botId, "On Kimi"));
+ expect(started).toMatchObject({ modelSelection: kimi, followsBotModel: false, approvalMode: "ask" });
+ expect((await profile(botId)).approvalMode).toBe("edits");
+}, 60_000);
diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.ts
index 8a5c56bc07..0c076da8d8 100644
--- a/src/components/BotSettingsDialog.simple.test.ts
+++ b/src/components/BotSettingsDialog.simple.test.ts
@@ -711,29 +711,17 @@ describe("the Details tab", () => {
expect(capture(() => EffortRow(row.props as Parameters<typeof EffortRow>[0])).html).toMatch(/<option value="max" selected="">/);
});
- it("sets an owner's reasoning level on the open conversation and as the bot's default, as the Model row does", () => {
- fixture.ownerOrAdmin = true;
- expect(pickHigh(thread())).toEqual({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true, selection: { ...opus, effort: "high" },
- });
- const haiku = { instanceId: "claude", model: "claude-haiku-4-5" };
- expect(pickHigh(thread({ ...haiku, effort: "low" }))).toEqual({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true, selection: { ...haiku, effort: "high" },
- });
- });
-
- it("keeps an owner's pick in a conversation on another engine to that conversation when the bot's approval level would first drop to Ask", () => {
+ it("keeps a reasoning pick in a conversation on another engine to that conversation, whatever the bot's approval level", () => {
fixture.ownerOrAdmin = true;
fixture.storeState = { ...fixture.storeState, instances: [engine(), engine({ instanceId: "codex", driverKind: "codex" })] };
const codex = { instanceId: "codex", model: "gpt-5.6" };
const onCodex = (approvalMode: Bot["approvalMode"]) => ({ ...thread({ ...codex, effort: "low" }), approvalMode });
- expect(pickHigh(onCodex("edits"))).toEqual({ type: "setModel", botId: "scout", threadId: "thread-scout", selection: { ...codex, effort: "high" } });
- expect(pickHigh(onCodex("full"))).toEqual({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true, selection: { ...codex, effort: "high" },
- });
+ for (const mode of ["edits", "full"] as const) {
+ expect(pickHigh(onCodex(mode))).toEqual({ type: "setModel", botId: "scout", threadId: "thread-scout", selection: { ...codex, effort: "high" } });
+ }
});
- it.each([false, null] as const)("sets a guest's reasoning level on the open conversation only, whatever its model (owner: %s)", (ownerOrAdmin) => {
+ it.each([true, false, null] as const)("sets the reasoning level on the open conversation only, whatever its model (owner: %s)", (ownerOrAdmin) => {
fixture.ownerOrAdmin = ownerOrAdmin;
expect(pickHigh(thread())).toEqual({ type: "setModel", botId: "scout", threadId: "thread-scout", selection: { ...opus, effort: "high" } });
const haiku = { instanceId: "claude", model: "claude-haiku-4-5" };
@@ -751,8 +739,7 @@ describe("the Details tab", () => {
fixture.ownerOrAdmin = ownerOrAdmin;
blank();
const haiku = { instanceId: "claude", model: "claude-haiku-4-5", effort: "max" as const };
- expect(pickHigh(thread(haiku))).toEqual({ type: "setModel", botId: "scout", threadId: "new-chat-scout",
- ...(ownerOrAdmin ? { updateBotDefault: true } : {}), selection: { ...opus, effort: "high" } });
+ expect(pickHigh(thread(haiku))).toEqual({ type: "setModel", botId: "scout", threadId: "new-chat-scout", selection: { ...opus, effort: "high" } });
});
it("shows the blank chat's choices in both rows, and a held level as picked", () => {
@@ -775,10 +762,6 @@ describe("the Details tab", () => {
const variants = capture(() => EffortRow(row.props as Parameters<typeof EffortRow>[0])).nodes[0]!;
expect(variants.props.threadId).toBe("new-chat-scout");
expect((variants.props.bot as Bot).modelSelection).toEqual({ ...opus, effort: "low" });
- expect(variants.props.updateBotDefault).toBe(false);
- fixture.ownerOrAdmin = true;
- const owned = ofType(botTab(thread({ ...opus, variant: "deep" })), EffortRow)!;
- expect(capture(() => EffortRow(owned.props as Parameters<typeof EffortRow>[0])).nodes[0]!.props.updateBotDefault).toBe(true);
});
it("leaves another bot's blank chat alone", () => {
diff --git a/src/components/CopilotModelPicker.test.ts b/src/components/CopilotModelPicker.test.ts
index 1fdb0ba7b3..1a8498bf68 100644
--- a/src/components/CopilotModelPicker.test.ts
+++ b/src/components/CopilotModelPicker.test.ts
@@ -99,17 +99,17 @@ it("lists the models Copilot advertised in the picker and saves one for the bot"
expect(listed).toEqual(expect.arrayContaining(["claude-haiku-4.5", "gpt-5.6-luna"]));
menu.props.onPick(copilot(), "gpt-5.6-luna");
expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: selected.id, threadId: selected.threadId,
- updateBotDefault: true, selection: { instanceId: "githubCopilot", model: "gpt-5.6-luna" } });
+ updateBotDefault: false, selection: { instanceId: "githubCopilot", model: "gpt-5.6-luna" } });
});
it("offers the picked Copilot model's own effort levels", () => {
fixture.instances = [copilot()];
const selected = bot("githubCopilot", "gpt-5.6-luna");
- const row = ModelVariantRow({ bot: selected, threadId: selected.threadId, updateBotDefault: true, compact: true });
+ const row = ModelVariantRow({ bot: selected, threadId: selected.threadId, compact: true });
const select = elements(row).find((entry) => entry.type === Select)!;
select.props.onChange!({ target: { value: "1" } } as ChangeEvent<HTMLSelectElement>);
expect(fixture.dispatch).toHaveBeenCalledExactlyOnceWith({ type: "setModel", botId: selected.id, threadId: selected.threadId,
- updateBotDefault: true, selection: { instanceId: "githubCopilot", model: "gpt-5.6-luna", variant: "high" } });
+ selection: { instanceId: "githubCopilot", model: "gpt-5.6-luna", variant: "high" } });
});
it("moves between Claude and Copilot without an approval reset", () => {
diff --git a/src/components/CustomAcpModelPicker.test.ts b/src/components/CustomAcpModelPicker.test.ts
index b69858ecf0..33b017f033 100644
--- a/src/components/CustomAcpModelPicker.test.ts
+++ b/src/components/CustomAcpModelPicker.test.ts
@@ -100,7 +100,7 @@ it.each(["zcode", "codebuddy", "qoder", "qodercn"])("offers discovered models in
expect(opened.html).toContain(">GLM-5.3</span>");
pane.props.onPick(fixture.instances[0]!, "glm-5.3-flash");
expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: selected.id, threadId: selected.threadId,
- updateBotDefault: true, selection: { instanceId, model: "glm-5.3-flash" } });
+ updateBotDefault: false, selection: { instanceId, model: "glm-5.3-flash" } });
const saved = { ...selected, modelSelection: { instanceId, model: "glm-5.3-flash" } };
// A model with thinking choices keeps the menu open, so its thinking row is offered right away.
const stillOpen = renderPicker(saved);
@@ -113,7 +113,7 @@ it.each(["zcode", "codebuddy", "qoder", "qodercn"])("offers discovered models in
expect(stillOpen.html).not.toContain(">Max</option>");
thinking.props.onChange!({ target: { value: "1" } } as ChangeEvent<HTMLSelectElement>);
expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: selected.id, threadId: selected.threadId,
- updateBotDefault: true, selection: { instanceId, model: "glm-5.3-flash", variant: "high" } });
+ selection: { instanceId, model: "glm-5.3-flash", variant: "high" } });
fixture.values = []; fixture.index = 0; fixture.own = 0;
expect(openPicker({ ...saved, modelSelection: { ...saved.modelSelection, variant: "high" } }).html).toContain('selected="">high</option>');
});
@@ -121,7 +121,7 @@ it.each(["zcode", "codebuddy", "qoder", "qodercn"])("offers discovered models in
it.each(["zcode", "codebuddy", "qoder", "qodercn"])("uses model-specific thinking choices and saves only the selected %s bot", (instanceId) => {
fixture.instances = [engine(instanceId), engine("other-custom")];
const selected = bot(instanceId, "full", "low");
- const row = ModelVariantRow({ bot: selected, threadId: selected.threadId, updateBotDefault: true, compact: true });
+ const row = ModelVariantRow({ bot: selected, threadId: selected.threadId, compact: true });
const picker = elements(row).find((entry) => entry.type === Select)!;
const markup = renderToStaticMarkup(createElement(ModelVariantRow, { bot: selected, threadId: selected.threadId, compact: true }));
expect(markup).toContain('aria-label="Reasoning variant"');
@@ -130,7 +130,7 @@ it.each(["zcode", "codebuddy", "qoder", "qodercn"])("uses model-specific thinkin
expect(markup).not.toContain(">High</option>");
picker.props.onChange!({ target: { value: "1" } } as ChangeEvent<HTMLSelectElement>);
expect(fixture.dispatch).toHaveBeenCalledExactlyOnceWith({ type: "setModel", botId: selected.id, threadId: selected.threadId,
- updateBotDefault: true, selection: { instanceId, model: "full", variant: "max" } });
+ selection: { instanceId, model: "full", variant: "max" } });
});
it("drops the previous model's thinking choice and displays the new model's supported choices", () => {
diff --git a/src/components/ModelPicker.dom.test.ts b/src/components/ModelPicker.dom.test.ts
index 4f900dbd75..ef01c7b4c3 100644
--- a/src/components/ModelPicker.dom.test.ts
+++ b/src/components/ModelPicker.dom.test.ts
@@ -491,16 +491,15 @@ describe("while the bot is working", () => {
const panel = menu()!.querySelector<HTMLElement>("[data-model-busy]")!;
expect(panel.textContent).toContain("Reasoning level applies from the next message");
expect(panel.textContent).toContain("Stop this thread's turn before changing its model");
- expect(panel.textContent).toContain("The bot's model: this thread, groups, and every thread that uses the bot's model.");
expect(menu()!.querySelector("[data-simple-models]")).toBeNull();
for (const option of three) expect(menu()!.textContent).not.toContain(option.label);
const effort = panel.querySelector<HTMLSelectElement>("select")!;
effort.value = "high";
flushSync(() => effort.dispatchEvent(new Event("change", { bubbles: true })));
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true,
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({
+ type: "setModel", botId: "scout", threadId: "thread-scout",
selection: { instanceId: "claude", model: "claude-opus-5-5", effort: "high" },
- }));
+ });
});
it("keeps a reasoning pick on a thread with its own model to that thread, so the bot's model is not overwritten", async () => {
@@ -509,7 +508,6 @@ describe("while the bot is working", () => {
render(busy);
await openWith("click");
const panel = menu()!.querySelector<HTMLElement>("[data-model-busy]")!;
- expect(panel.textContent).toContain("This thread only. It keeps this model when the bot's model changes.");
const effort = panel.querySelector<HTMLSelectElement>("select")!;
effort.value = "high";
flushSync(() => effort.dispatchEvent(new Event("change", { bubbles: true })));
diff --git a/src/components/ModelPicker.simple.test.ts b/src/components/ModelPicker.simple.test.ts
index d447a92a96..486f846526 100644
--- a/src/components/ModelPicker.simple.test.ts
+++ b/src/components/ModelPicker.simple.test.ts
@@ -355,7 +355,7 @@ describe("the model picker in Simple mode", () => {
expect(bottom).toMatch(/data-effort-auto="true" aria-pressed="false"[^>]*title="The model decides how hard to think."[^>]*>Auto<\/button>/);
thinking(opened).onReset();
expect(fixture.dispatch).toHaveBeenLastCalledWith({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true,
+ type: "setModel", botId: "scout", threadId: "thread-scout",
selection: { instanceId: "claude", model: "claude-opus-5-5" },
});
fixture.values = [];
@@ -458,18 +458,19 @@ describe("the model picker in Simple mode", () => {
expect(renderToStaticMarkup(render(bot()).nodes.find((node) => node.props["data-tour"] === "model")!)).not.toContain("data-model-attention");
});
- it("makes every pick the bot's default too, so new threads start on it, with no checkbox", () => {
+ it("keeps a pick in a thread to that thread, with no checkbox or scope switch", () => {
const opened = open(bot());
expect(opened.html).not.toContain('type="checkbox"');
+ expect(opened.html).not.toContain("Apply model changes to");
pane(opened)!.props.onPick(instance("claude"), "claude-sonnet-5-5");
expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true,
+ type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: false,
selection: expect.objectContaining({ instanceId: "claude", model: "claude-sonnet-5-5" }),
}));
});
- it.each([[true, false], [true, null], [false, false], [false, null]] as const)(
- "keeps a guest's model and effort changes thread-only (Cloud: %s, owner status: %s)", (cloudHome, ownerOrAdmin) => {
+ it.each([[false, true], [true, true], [true, false], [true, null], [false, false], [false, null]] as const)(
+ "keeps everyone's model and effort changes in a thread to that thread (Cloud: %s, owner status: %s)", (cloudHome, ownerOrAdmin) => {
fixture.cloudHome = cloudHome;
fixture.ownerOrAdmin = ownerOrAdmin;
const opened = open(bot());
@@ -485,28 +486,7 @@ describe("the model picker in Simple mode", () => {
});
});
- it("still updates defaults for the Cloud owner", () => {
- fixture.cloudHome = true;
- const opened = open(bot());
- pane(opened)!.props.onPick(instance("claude"), "claude-sonnet-5-5");
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ updateBotDefault: true }));
- thinking(opened).onPick("high");
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ updateBotDefault: true }));
- });
-
- it("does not reuse the full picker's bot scope for a Cloud guest's Simple choice", () => {
- fixture.cloudHome = true;
- fixture.advanced = true;
- const forBot = bot();
- const full = open(forBot);
- click(full.nodes.find((node) => node.type === "button" && node.props.children === "Thread + bot default"));
- fixture.ownerOrAdmin = false;
- fixture.advanced = false;
- pane(render(forBot))!.props.onPick(instance("claude"), "claude-sonnet-5-5");
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ updateBotDefault: false }));
- });
-
- it.each([false, null, true])("uses the Cloud owner's actual authority for named-variant defaults (%s)", (ownerOrAdmin) => {
+ it.each([false, null, true])("keeps a named-variant pick in the thread whoever picks it (owner status: %s)", (ownerOrAdmin) => {
fixture.cloudHome = true;
fixture.ownerOrAdmin = ownerOrAdmin;
const variants = [{ id: "default", label: "Default" }, { id: "high", label: "High" }];
@@ -516,30 +496,21 @@ describe("the model picker in Simple mode", () => {
(select.props.onChange as (event: unknown) => void)({ target: { value: "1" } });
expect(fixture.dispatch).toHaveBeenLastCalledWith({
type: "setModel", botId: "scout", threadId: "thread-scout",
- ...(ownerOrAdmin === true ? { updateBotDefault: true } : {}),
selection: { instanceId: "claude", model: "claude-opus-5-5", variant: "high" },
});
});
- it("keeps the Advanced picker's own scope choice (this thread unless asked)", () => {
+ it.each([true, false, null])("has no scope switch in the Advanced picker: its model and effort picks change this thread only (owner status: %s)", (ownerOrAdmin) => {
fixture.advanced = true;
+ fixture.ownerOrAdmin = ownerOrAdmin;
const opened = open(bot());
expect(pane(opened)).toBeUndefined();
- expect(opened.html).toContain("Only this thread");
- });
-
- it.each([false, null])("offers a guest no bot scope in the full picker and keeps its picks thread-only (owner status: %s)", (ownerOrAdmin) => {
- fixture.advanced = true;
- const forBot = bot();
- const asOwner = open(forBot);
- click(asOwner.nodes.find((node) => node.type === "button" && node.props.children === "Thread + bot default"));
- fixture.ownerOrAdmin = ownerOrAdmin;
- const asGuest = render(forBot);
- expect(asGuest.html).not.toContain("Thread + bot default");
- const effort = asGuest.nodes.find((node) => node.type === EffortRow)!;
- expect(effort.props.updateBotDefault).toBe(false);
- (asGuest.nodes.find((node) => (node.props.option as Option | undefined)?.id === "claude-sonnet-5-5")!.props.onPick as () => void)();
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ type: "setModel", updateBotDefault: false }));
+ expect(opened.html).not.toContain("Only this thread");
+ expect(opened.html).not.toContain("Thread + bot default");
+ const effort = opened.nodes.find((node) => node.type === EffortRow)!;
+ expect(effort.props).not.toHaveProperty("updateBotDefault");
+ (opened.nodes.find((node) => (node.props.option as Option | undefined)?.id === "claude-sonnet-5-5")!.props.onPick as () => void)();
+ expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ type: "setModel", threadId: "thread-scout", updateBotDefault: false }));
});
it("opens the same floating menu from bot settings' Default model, without a second Thinking control, and edits the bot's default", () => {
@@ -612,24 +583,21 @@ describe("the model picker in Simple mode", () => {
}));
});
- it.each([[true, true], [false, false], [null, false]] as const)(
- "lets the bot panel's picker, given the open thread, set the default only for the Cloud owner (owner: %s)",
- (ownerOrAdmin, updatesDefault) => {
- fixture.cloudHome = true;
- fixture.ownerOrAdmin = ownerOrAdmin;
- const simple = pane(open(bot(), { contained: true, thread: true }))!;
- expect(simple.props.thinking).toBeNull();
- simple.props.onPick(instance("claude"), "claude-haiku-4-5-20251001");
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: updatesDefault,
- }));
- },
- );
+ it.each([true, false, null] as const)("keeps the bot panel's picker, given the open thread, to that thread (owner: %s)", (ownerOrAdmin) => {
+ fixture.cloudHome = true;
+ fixture.ownerOrAdmin = ownerOrAdmin;
+ const simple = pane(open(bot(), { contained: true, thread: true }))!;
+ expect(simple.props.thinking).toBeNull();
+ simple.props.onPick(instance("claude"), "claude-haiku-4-5-20251001");
+ expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({
+ type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: false,
+ }));
+ });
it("writes the picked effort level", () => {
thinking(open(bot())).onPick("high");
expect(fixture.dispatch).toHaveBeenLastCalledWith({
- type: "setModel", botId: "scout", threadId: "thread-scout", updateBotDefault: true,
+ type: "setModel", botId: "scout", threadId: "thread-scout",
selection: { instanceId: "claude", model: "claude-opus-5-5", effort: "high" },
});
});
@@ -688,8 +656,8 @@ describe("the model picker in Simple mode", () => {
expect(render(bot()).html).not.toContain("data-model-picker-content");
});
- it.each([[true, true], [false, false], [null, false]] as const)(
- "keeps the list's rule for a pick in the full picker behind Set up (owner: %s)", (ownerOrAdmin, updatesDefault) => {
+ it.each([true, false, null] as const)(
+ "keeps the list's rule for a pick in the full picker behind Set up (owner: %s)", (ownerOrAdmin) => {
fixture.ownerOrAdmin = ownerOrAdmin;
const missing: InstanceInfo = { ...cursor, snapshot: { state: "unavailable", reason: "`cursor-agent` isn't installed" } };
fixture.instances = [claude(), missing];
@@ -697,11 +665,10 @@ describe("the model picker in Simple mode", () => {
pane(open(forBot))!.props.onSetUp(missing, false);
fixture.instances = [claude(), cursor];
const full = render(forBot);
- expect(menu(full.html).includes("every thread that uses the bot&#x27;s model")).toBe(updatesDefault);
- expect(menu(full.html).includes("Thread + bot default")).toBe(updatesDefault);
+ expect(menu(full.html)).not.toContain("Thread + bot default");
(full.nodes.find((node) => node.type === ModelRow)!.props.onPick as () => void)();
expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({
- type: "setModel", threadId: "thread-scout", updateBotDefault: updatesDefault,
+ type: "setModel", threadId: "thread-scout", updateBotDefault: false,
selection: expect.objectContaining({ instanceId: "cursor", model: "auto" }),
}));
},
@@ -943,7 +910,7 @@ describe("a thread's picker and its bot's model", () => {
it("says on the current model that a thread follows its bot, with no follow row to click", () => {
const opened = open(scout(null));
expect(list(opened).follow).toBe(false);
- expect(list(opened).current!.meta).toBe("Scout's model, used in all its chats");
+ expect(list(opened).current!.meta).toBe("Scout's model");
expect(menu(opened.html)).not.toContain("data-follow-bot-model");
expect(render(scout(null)).nodes.find((node) => node.props["data-tour"] === "model")!.props.title).toContain("Uses Scout's model");
});
@@ -977,26 +944,13 @@ describe("a thread's picker and its bot's model", () => {
expect(closed).not.toContain("data-thread-models-notice");
});
- it("once the menu closes after a pick changes the bot's model, says how many threads keep their own, until it opens again", () => {
+ it("keeps a pick to its thread: other threads, following the bot's model or not, are left alone and no notice counts them", () => {
const forBot = scout(null, [{ threadId: "kept", model: haiku }, { threadId: "follows", model: null }]);
const opened = open(forBot);
pane(opened)!.props.onPick(instance("claude"), "claude-sonnet-5-5");
- expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ type: "setModel", updateBotDefault: true }));
- // Sonnet 5.5 has effort levels, so the menu stays open for them; the chip closes it.
- expect(render(forBot).html).not.toContain("data-thread-models-notice");
- const closed = open(forBot);
- expect(closed.html).toContain("data-thread-models-notice");
- expect(closed.html).toContain("menu-surface");
- expect(closed.html).toContain("1 thread uses its own model.");
- expect(closed.html).toContain("Switch it too");
- open(forBot);
- expect(render(forBot).html).not.toContain("data-thread-models-notice");
- });
-
- it("says nothing after a bot model change when every thread follows the bot", () => {
- const forBot = scout(null, [{ threadId: "follows", model: null }]);
- pane(open(forBot))!.props.onPick(instance("claude"), "claude-sonnet-5-5");
- expect(render(forBot).html).not.toContain("data-thread-models-notice");
+ expect(fixture.dispatch).toHaveBeenCalledTimes(1);
+ expect(fixture.dispatch).toHaveBeenLastCalledWith(expect.objectContaining({ type: "setModel", threadId: "thread-scout", updateBotDefault: false }));
+ expect(open(forBot).html).not.toContain("data-thread-models-notice");
});
});
@@ -1050,7 +1004,6 @@ describe("every capability of the picker stays reachable", () => {
const behind = {
"the full picker opens in place, with a way back": pane(full) === undefined && fullHtml.includes("data-model-back"),
"engine rail with API keys": full.nodes.some((node) => node.type === ModelEngineRail) && fullHtml.includes(">API keys<"),
- "this thread or the bot's default": fullHtml.includes("Only this thread") && fullHtml.includes("Thread + bot default"),
"engine status and refresh": fullHtml.includes("Sign-in required") && fullHtml.includes("data-model-refresh"),
"the account select": fullHtml.includes('<option value="claude-work" selected="">Work</option>'),
"install and sign-in help": full.nodes.some((node) => node.type === EngineSetup),
@@ -1098,7 +1051,6 @@ describe("every capability of the picker stays reachable", () => {
"use the bot's model, checked while following": opened.nodes.some((node) => node.type === FollowBotModelRow),
"engine rail with Cloud, API keys and Local, and a way to add keys": html.includes(">Cloud<") && html.includes(">API keys<") && html.includes(">Local<") && html.includes("data-rail-add-api-key"),
"a managed engine stays on the rail, dimmed": html.includes("Managed by Acme") && html.includes("opacity-40"),
- "this thread or the bot's default": html.includes("Only this thread"),
"engine name, refresh and version": html.includes("data-model-refresh") && html.includes("2.1.300"),
"the Claude account select": html.includes('aria-label="Account"'),
"the engine's update notice": html.includes("Update Claude"),
diff --git a/src/components/ModelPicker.test.ts b/src/components/ModelPicker.test.ts
index 0c67183312..2aea8acc7f 100644
--- a/src/components/ModelPicker.test.ts
+++ b/src/components/ModelPicker.test.ts
@@ -74,13 +74,13 @@ function renderEffort(instances: InstanceInfo[], effort?: EffortLevel): string {
describe("EffortRow", () => {
it("uses a compact dropdown without changing scope or conflating None with Default", () => {
fixture.instances = [engine(["none", "low", "high"])];
- const row = EffortRow({ bot: bot("high"), threadId: "independent-thread", updateBotDefault: true, compact: true })!;
+ const row = EffortRow({ bot: bot("high"), threadId: "independent-thread", compact: true })!;
const select = Children.toArray(row.props.children).at(-1) as ReactElement<{ value: string; onChange: (event: ChangeEvent<HTMLSelectElement>) => void }>;
expect(select.type).toBe(Select);
expect(select.props.value).toBe("high");
for (const value of ["none", ""]) {
select.props.onChange({ target: { value } } as ChangeEvent<HTMLSelectElement>);
- expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: "atlas", threadId: "independent-thread", updateBotDefault: true,
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: "atlas", threadId: "independent-thread",
selection: { instanceId: "codex", model: "gpt-5.6", effort: value || undefined } });
}
const markup = renderToStaticMarkup(createElement(EffortRow, { bot: bot(), compact: true }));
@@ -88,14 +88,6 @@ describe("EffortRow", () => {
expect(markup).not.toContain("<button");
expect([...markup.matchAll(/<option[^>]*>([^<]+)</g)].map((match) => match[1])).toEqual(["Default", "None", "Low", "High"]);
});
- it("can apply effort to the pinned thread and bot default together", () => {
- fixture.instances = [engine(["high"])];
- const row = EffortRow({ bot: bot(), threadId: "thread-atlas", updateBotDefault: true })!;
- const levels = Children.toArray(row.props.children).at(-1) as ReactElement<{ children: ReactNode }>;
- const high = Children.toArray(levels.props.children)[1] as ReactElement<{ onClick: () => void }>;
- high.props.onClick();
- expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: "atlas", threadId: "thread-atlas", updateBotDefault: true, selection: { instanceId: "codex", model: "gpt-5.6", effort: "high" } });
- });
it("pins thread effort changes without changing profile defaults", () => {
fixture.instances = [engine(["high"])];
const row = EffortRow({ bot: bot(), threadId: "independent-thread" })!;
@@ -272,10 +264,10 @@ describe("OpenCode model variants", () => {
it("keeps the saved choice after reload while allowing profile choices to update the profile", () => {
expect(levelButtons(render("minimal")).find((button) => button.pressed)?.label).toBe("Minimal");
- const row = ModelVariantRow({ bot: selected(), updateBotDefault: true })!;
+ const row = ModelVariantRow({ bot: selected() })!;
const group = Children.toArray(row.props.children).at(-1) as ReactElement<{ children: ReactNode }>;
(Children.toArray(group.props.children)[1] as ReactElement<{ onClick: () => void }>).props.onClick();
- expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: "atlas", threadId: undefined, updateBotDefault: true,
+ expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "setModel", botId: "atlas", threadId: undefined,
selection: { instanceId: "opencode", model: "provider/model", variant: "minimal" } });
});
diff --git a/src/components/ModelPicker.tsx b/src/components/ModelPicker.tsx
index 3cad61516f..651a4a404f 100644
--- a/src/components/ModelPicker.tsx
+++ b/src/components/ModelPicker.tsx
@@ -2,7 +2,7 @@ import { GlmServer, GLM_SETUP_ID } from "./OpenAiCompatServers";
import { modelLabel, modelProvider } from "@/lib/model-label";
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from "react";
import { createPortal } from "react-dom";
-import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, KeyRound, Loader2, RefreshCw, X } from "lucide-react";
+import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, KeyRound, Loader2, RefreshCw } from "lucide-react";
import { currentTaskBot, type Bot, type InstanceInfo, type ModelSelection } from "@/state/store"; import { sameFields, useStoreActions, useStoreDispatch, useStoreSelector } from "@/state/store-select";
import { offeredEffortLevels, type EffortLevel } from "../../shared/wire";
import { filterCustomModels, partitionCustomModels, suggestedModels } from "@/lib/custom-models";
@@ -34,8 +34,7 @@ import { t } from "@/lib/i18n";
import { COMPACT_SQUARE } from "@/lib/compact-chip";
import { useAiSwitch } from "@/lib/ai-switch";
import { usePickerPane } from "@/lib/model-picker-pane";
-import { threadsOnOwnModel } from "../../shared/thread-model";
-import { ThreadModelsLine } from "./ThreadModelsLine"; import { SimpleModelTrigger } from "./ModelPickerTrigger";
+import { SimpleModelTrigger } from "./ModelPickerTrigger";
import { USAGE_WARN_WIDENS, UsageBars, UsageMenuRows } from "./EngineUsage";
import { Select } from "./Select";
@@ -52,14 +51,12 @@ export function effortLabel(level: EffortLevel): string {
export function EffortRow({
bot,
threadId,
- updateBotDefault,
className,
label,
compact = false,
}: {
bot: Bot;
threadId?: string;
- updateBotDefault?: boolean;
className?: string;
label?: ReactNode;
compact?: boolean;
@@ -68,7 +65,7 @@ export function EffortRow({
const selection = bot.modelSelection;
const instance = state.instances.find((candidate) => candidate.instanceId === selection.instanceId);
if (instance?.capabilities?.modelVariants) {
- return <ModelVariantRow bot={bot} threadId={threadId} updateBotDefault={updateBotDefault} className={className} label={label} compact={compact} quiet={compact} />;
+ return <ModelVariantRow bot={bot} threadId={threadId} className={className} label={label} compact={compact} quiet={compact} />;
}
const levels = offeredEffortLevels(instance, selection.model);
if (!levels?.length) return null;
@@ -77,7 +74,7 @@ export function EffortRow({
<label className={cn("flex items-center justify-between gap-3", className)}>
{label}
<Select size="sm" variant="quiet" className="max-w-[65%]" aria-label={t("model.effort.label")} value={selection.effort ?? ""}
- onChange={(event) => dispatch({ type: "setModel", botId: bot.id, threadId, ...(updateBotDefault ? { updateBotDefault: true } : {}),
+ onChange={(event) => dispatch({ type: "setModel", botId: bot.id, threadId,
selection: { ...selection, effort: levels.find((level) => level === event.target.value) } })}>
<option value="">{t("model.effort.default")}</option>
{levels.map((level) => <option key={level} value={level}>{effortLabel(level)}</option>)}
@@ -99,7 +96,7 @@ export function EffortRow({
? t("model.effort.noLevel")
: t("model.effort.ask", { level: effortLabel(level) })
}
- onClick={() => dispatch({ type: "setModel", botId: bot.id, threadId, ...(updateBotDefault ? { updateBotDefault: true } : {}), selection: { ...selection, effort: level } })}
+ onClick={() => dispatch({ type: "setModel", botId: bot.id, threadId, selection: { ...selection, effort: level } })}
className={cn(
"rounded-full border px-2.5 py-1 text-[12px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/70",
selection.effort === level
@@ -115,10 +112,9 @@ export function EffortRow({
);
}
-export function ModelVariantRow({ bot, threadId, updateBotDefault, className, label, compact = false, wide = false, quiet = false }: {
+export function ModelVariantRow({ bot, threadId, className, label, compact = false, wide = false, quiet = false }: {
bot: Bot;
threadId?: string;
- updateBotDefault?: boolean;
className?: string;
label?: ReactNode;
compact?: boolean;
@@ -135,8 +131,7 @@ export function ModelVariantRow({ bot, threadId, updateBotDefault, className, la
const current = reported?.currentValue;
const choose = (variant?: string) => {
const { effort: _effort, variant: _variant, ...model } = selection;
- dispatch({ type: "setModel", botId: bot.id, threadId, ...(updateBotDefault ? { updateBotDefault: true } : {}),
- selection: { ...model, ...(variant !== undefined ? { variant } : {}) } });
+ dispatch({ type: "setModel", botId: bot.id, threadId, selection: { ...model, ...(variant !== undefined ? { variant } : {}) } });
};
if (compact) return (
<div className={className}>
@@ -225,16 +220,12 @@ export function ModelPicker({
const [refreshingId, setRefreshingId] = useState<string | null>(null);
const [probing, setProbing] = useState<ReadonlySet<string>>(() => new Set());
const [expanded, setExpanded] = useState<ReadonlySet<string>>(() => new Set());
- const [scope, setScope] = useState<"bot" | "thread">("thread");
const advanced = useAdvancedMode();
const ownerOrAdmin = useOwnerOrAdmin();
- // A guest changes only their own conversation's model, never the shared bot's default; thread-only until authority loads.
- const simpleUpdatesBotDefault = ownerOrAdmin === true;
const [fullView, setFullView] = useState(false);
const [pendingSwitch, setPendingSwitch] = useState<{ botId: string; threadId: string;
selection: ModelSelection; updateBotDefault: boolean; name: string } | null>(null);
const [placement, setPlacement] = useState<PickerPlacement | null>(null);
- const [changedBotModel, setChangedBotModel] = useState(false);
const rootRef = useRef<HTMLDivElement>(null);
const triggerRef = useRef<HTMLButtonElement>(null);
const menuRef = useRef<HTMLDivElement>(null);
@@ -413,7 +404,6 @@ export function ModelPicker({
if (active && signInFamily(active) === "openai") lastOpenaiIdRef.current = active.instanceId;
const initial = pickerInstances.find((instance) => instance.instanceId === selection.instanceId) ?? pickerInstances[0];
setRailId(initial?.instanceId ?? null);
- setChangedBotModel(false);
setFullView(false);
setExpanded(new Set());
setPlacement(null);
@@ -424,7 +414,6 @@ export function ModelPicker({
const openFull = (instance: InstanceInfo, keyboard: boolean) => {
selectRail(instance);
- setScope(simpleUpdatesBotDefault ? "bot" : "thread");
focusOnPlace.current = keyboard ? "[data-model-back]" : MENU_ITSELF;
setFullView(true);
};
@@ -438,9 +427,6 @@ export function ModelPicker({
const follows = threadId ? profile.tasks?.find((task) => task.threadId === threadId)?.followsBotModel : undefined;
const botModelInstance = state.instances.find((instance) => instance.instanceId === profile.modelSelection.instanceId);
const botModelName = botModelInstance ? `${engineDisplayName(botModelInstance)} · ${modelLabel(botModelInstance, profile.modelSelection.model)}${variantSuffix(botModelInstance, profile.modelSelection.model, profile.modelSelection.variant)}` : profile.modelSelection.model;
- const busyUpdatesBotDefault = Boolean(threadId) && simpleUpdatesBotDefault && (simpleView || scope === "bot")
- && bot.modelSelection.instanceId === profile.modelSelection.instanceId && bot.modelSelection.model === profile.modelSelection.model;
- const ownModelThreads = threadsOnOwnModel(profile.modelSelection, profile.tasks ?? []).length;
const pickBotModel = () => {
if (bot.busy) return;
@@ -464,7 +450,7 @@ export function ModelPicker({
if (bot.busy || instance.policy) return;
const nextSelection = modelSelectionForPick(selection, instance, model);
if (variant !== undefined) nextSelection.variant = variant;
- const updateBotDefault = !threadId || (simpleUpdatesBotDefault && (simpleView || scope === "bot"));
+ const updateBotDefault = !threadId;
const targets = [currentTaskBot(profile, threadId ?? bot.threadId), ...(updateBotDefault ? [profile] : [])];
if (targets.some((target) => modelSwitchNeedsAsk(approvalModeFor(target),
state.instances.find((candidate) => candidate.instanceId === target.modelSelection.instanceId)?.driverKind,
@@ -481,7 +467,6 @@ export function ModelPicker({
updateBotDefault,
selection: nextSelection,
});
- if (updateBotDefault && threadId) setChangedBotModel(true);
// A model with reasoning levels keeps the menu open, so its level can be set next without opening it again;
// picking a variant row already sets that level.
if (variant !== undefined || contained || !offersReasoning(state, instance, nextSelection, threadId ?? bot.threadId)) close(true);
@@ -525,13 +510,12 @@ export function ModelPicker({
const levels = offeredEffortLevels(active, selection.model);
const writeEffort = (effort: EffortLevel | undefined) => {
const { effort: _effort, ...model } = selection;
- dispatch({ type: "setModel", botId: bot.id, threadId, ...(threadId && simpleUpdatesBotDefault ? { updateBotDefault: true } : {}),
- selection: effort ? { ...model, effort } : model });
+ dispatch({ type: "setModel", botId: bot.id, threadId, selection: effort ? { ...model, effort } : model });
};
const thinking: SimpleThinking | null = contained ? null
: variantChoices(state, selection, threadId ?? bot.threadId) ? {
variants: (
- <ModelVariantRow compact quiet bot={shown} threadId={threadId} updateBotDefault={Boolean(threadId) && simpleUpdatesBotDefault} className="px-2 py-1"
+ <ModelVariantRow compact quiet bot={shown} threadId={threadId} className="px-2 py-1"
label={<span className="shrink-0 text-[12px] font-medium leading-4 text-ink-tertiary">{t("botSettings.simple.thinking")}</span>} />
),
}
@@ -652,7 +636,7 @@ export function ModelPicker({
instances,
listed: pickerInstances,
selection,
- bot: { name: profile.name, selection: profile.modelSelection, follows }, updatesBotDefault: !threadId || simpleUpdatesBotDefault,
+ bot: { name: profile.name, selection: profile.modelSelection, follows },
query,
expanded,
probing,
@@ -678,22 +662,6 @@ export function ModelPicker({
onAddApiKeys={remote ? undefined : openApiKeys} glmSetup={glmSetup} onSetUpGlm={canSetUpGlm ? setUpGlm : undefined} />}
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto">
- {threadId && simpleUpdatesBotDefault && (
- <div className="shrink-0 border-b-[0.5px] border-ink/10 px-3.5 py-2">
- <div role="group" aria-label={t("model.scope.label")} className="flex flex-col gap-1">
- {(["thread", "bot"] as const).map((value) => (
- <button key={value} type="button" aria-pressed={scope === value} onClick={() => setScope(value)}
- className={cn("w-full rounded-lg px-2.5 py-1.5 text-start text-[12px] leading-snug",
- scope === value ? "bg-ink/[0.08] font-medium text-ink" : "text-ink-secondary hover:bg-ink/[0.06] hover:text-ink")}>
- {value === "bot" ? t("model.scope.bot") : t("model.scope.thread")}
- </button>
- ))}
- </div>
- <p className="mt-1.5 text-[12px] leading-4 text-ink-tertiary">
- {scope === "bot" ? t("model.scope.botHelp") : t("model.scope.threadHelp")}
- </p>
- </div>
- )}
{glmSetup && canSetUpGlm ? <GlmServer onAdded={(id) => { setRailId(id); setPane("main"); resetList(); }} /> : railInstance ? (
<>
<div className="shrink-0 px-3.5 pb-2 pt-3">
@@ -863,7 +831,6 @@ export function ModelPicker({
compact
bot={shown}
threadId={threadId}
- updateBotDefault={Boolean(threadId && simpleUpdatesBotDefault && scope === "bot")}
className="shrink-0 border-t-[0.5px] border-ink/10 px-3.5 py-[5px]"
label={<span className="text-[13px] leading-[18px] text-ink">{active?.capabilities?.modelVariants ? t("model.simple.reasoning") : t("model.section.effort")}</span>}
/>
@@ -939,7 +906,7 @@ export function ModelPicker({
className={cn("menu-surface z-[80] flex flex-col overflow-hidden", motion.className)}
>
<UsageMenuRows engine={selection.instanceId} />
- {bot.busy ? <BusyModelMenu bot={shown} threadId={threadId} updateBotDefault={busyUpdatesBotDefault} variants={Boolean(active?.capabilities?.modelVariants)} /> : simpleMenu ? (
+ {bot.busy ? <BusyModelMenu bot={shown} threadId={threadId} variants={Boolean(active?.capabilities?.modelVariants)} /> : simpleMenu ? (
<SimpleModelMenu
menu={simpleMenu}
query={query}
@@ -981,16 +948,6 @@ export function ModelPicker({
trigger
)}
{menu && floating ? createPortal(menu, document.body) : menu}
- {!contained && changedBotModel && !open && ownModelThreads > 0 && (
- <div data-thread-models-notice role="status"
- className={cn("menu-surface absolute z-30 flex w-max max-w-[min(300px,calc(100vw-2rem))] items-center gap-2 py-1.5 pl-3 pr-1.5 text-[13px] leading-[18px]", quiet ? "bottom-full left-0 mb-1" : "right-0 top-full mt-1")}>
- <ThreadModelsLine bot={profile} />
- <button type="button" aria-label={t("common.close")} onClick={() => setChangedBotModel(false)}
- className="flex size-6 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-ink/[0.06] hover:text-ink">
- <X size={14} aria-hidden="true" />
- </button>
- </div>
- )}
<ConfirmDialog
open={pendingSwitch !== null}
title={t("model.providerSwitch.title")}
@@ -1007,7 +964,6 @@ export function ModelPicker({
dispatch({ type: "setModel", botId: pendingSwitch.botId, threadId: pendingSwitch.threadId,
selection: pendingSwitch.selection, updateBotDefault: pendingSwitch.updateBotDefault,
resetApprovalToAsk: true });
- if (pendingSwitch.updateBotDefault && threadId) setChangedBotModel(true);
setPendingSwitch(null);
}}
/>
diff --git a/src/components/ModelPickerBusyMenu.tsx b/src/components/ModelPickerBusyMenu.tsx
index b6f1f894bd..4b506185fc 100644
--- a/src/components/ModelPickerBusyMenu.tsx
+++ b/src/components/ModelPickerBusyMenu.tsx
@@ -2,22 +2,16 @@ import type { Bot } from "@/state/store";
import { t } from "@/lib/i18n";
import { EffortRow } from "./ModelPicker";
-export function BusyModelMenu({ bot, threadId, updateBotDefault, variants }: { bot: Bot; threadId?: string; updateBotDefault: boolean; variants: boolean }) {
+export function BusyModelMenu({ bot, threadId, variants }: { bot: Bot; threadId?: string; variants: boolean }) {
return (
<div data-model-busy className="flex flex-col py-1">
<EffortRow
compact
bot={bot}
threadId={threadId}
- updateBotDefault={updateBotDefault}
className="px-3.5 py-[5px]"
label={<span className="text-[13px] leading-[18px] text-ink">{variants ? t("model.simple.reasoning") : t("model.section.effort")}</span>}
/>
- {threadId && (
- <p data-model-busy-scope className="px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary">
- {t(updateBotDefault ? "model.scope.botHelp" : "model.scope.threadHelp")}
- </p>
- )}
<p className="px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary">{t("model.reasoningNextTurn")}</p>
<p className="px-3.5 py-1 text-[12px] leading-4 text-ink-tertiary">{t(threadId ? "model.threadBusy" : "model.busy")}</p>
</div>
diff --git a/src/components/bot-panel/DetailsTab.tsx b/src/components/bot-panel/DetailsTab.tsx
index 02547fab42..389376fd29 100644
--- a/src/components/bot-panel/DetailsTab.tsx
+++ b/src/components/bot-panel/DetailsTab.tsx
@@ -14,8 +14,6 @@ import { TryAsking } from "./TryAsking";
import { CardLabel, RowIcon, rowCls, RowText } from "./rows";
import { useStoreSelector } from "@/state/store-select";
import { newChatBot } from "@/state/new-chat";
-import { useOwnerOrAdmin } from "@/lib/use-owner-or-admin";
-import { approvalModeFor, modelSwitchNeedsAsk } from "../../../shared/approval-mode";
type Derived = ReturnType<typeof useBotSettingsDerived>;
@@ -55,14 +53,6 @@ export function DetailsTab({ bot, derived, onOpen }: {
// set the blank chat's choices, which the first send applies to the conversation it makes.
const newChat = useStoreSelector((state) => state.newChat);
const thread = currentTaskBot(newChatBot(bot, newChat));
- // Like the Model row, a Reasoning pick is also the bot's default, so new conversations start at it. A guest's pick
- // stays in their own conversation, and so does one that would move the bot onto an engine its approval level must
- // first drop to Ask for: the Model row asks about that, this row has nowhere to.
- const ownerOrAdmin = useOwnerOrAdmin();
- const instances = useStoreSelector((state) => state.instances);
- const driverOf = (instanceId: string) => instances.find((instance) => instance.instanceId === instanceId)?.driverKind;
- const reasoningSetsDefault = ownerOrAdmin === true
- && !modelSwitchNeedsAsk(approvalModeFor(bot), driverOf(bot.modelSelection.instanceId), driverOf(thread.modelSelection.instanceId));
const conversationItems = CONVERSATION_ITEMS.flatMap((key) => items.filter((item) => item.key === key));
return (
@@ -82,7 +72,6 @@ export function DetailsTab({ bot, derived, onOpen }: {
<EffortRow
bot={thread}
threadId={thread.threadId}
- updateBotDefault={reasoningSetsDefault}
compact
className={cn(rowCls, "min-w-0 flex-1 rounded-[8px]")}
label={<span className="flex shrink-0 items-center gap-2.5"><RowIcon icon={Sparkles} /><RowText title={t("model.simple.reasoning")} /></span>}
diff --git a/src/components/bot-settings/ModelSection.test.ts b/src/components/bot-settings/ModelSection.test.ts
index b4d3bd427a..9b8f69286d 100644
--- a/src/components/bot-settings/ModelSection.test.ts
+++ b/src/components/bot-settings/ModelSection.test.ts
@@ -135,4 +135,13 @@ describe("the bot's model in Bot settings", () => {
it("leaves the hint out while a bot is still being made", () => {
expect(render(true)).not.toContain(hint);
});
+
+ it("says which model new threads start on when the last thread pick differs from the bot's", () => {
+ const picked = { ...bot(undefined), newThreadModel: { instanceId: "codex", model: "gpt-b" } } as Bot;
+ const show = (draft: boolean, shown: Bot) => renderToStaticMarkup(createElement(BotEditorContext.Provider, { value: { request: vi.fn() as never, draft } },
+ createElement(ModelSection, { bot: shown })));
+ expect(show(false, picked)).toContain("New threads start on Codex GPT-B, the model last picked in a thread. Picking a model here changes that too.");
+ expect(show(false, bot(undefined))).not.toContain("data-new-thread-model");
+ expect(show(true, picked)).not.toContain("data-new-thread-model");
+ });
});
diff --git a/src/components/bot-settings/ModelSection.tsx b/src/components/bot-settings/ModelSection.tsx
index ece1a2142d..937e655e01 100644
--- a/src/components/bot-settings/ModelSection.tsx
+++ b/src/components/bot-settings/ModelSection.tsx
@@ -6,6 +6,7 @@ import { useBotEditor } from "./BotEditorContext";
import { ProposalStatus } from "./ProposalStatus";
import { CheckWorkSetting } from "./CheckWorkSetting";
import { ThreadModelsLine } from "../ThreadModelsLine";
+import { modelName } from "@/lib/simple-model-menu";
import { t } from "@/lib/i18n";
import { Select } from "../Select";
import { BackupReasoning } from "../BackupReasoning";
@@ -33,6 +34,12 @@ export function ModelSection({ bot }: { bot: Bot }) {
}
/>
{!draft && <ThreadModelsLine bot={bot} className="mt-3" />}
+ {!draft && bot.newThreadModel && (
+ <div data-new-thread-model className="mt-3 text-[13px] text-ink-secondary">
+ {t("model.section.newThreads", { model: modelName(state.instances.find((instance) => instance.instanceId === bot.newThreadModel!.instanceId),
+ bot.newThreadModel.model, bot.newThreadModel.variant) })}
+ </div>
+ )}
{!draft && <div className="mt-3 text-[13px] text-ink-secondary">{t("model.section.installationDefault")}</div>}
</div>
diff --git a/src/lib/simple-model-menu.ts b/src/lib/simple-model-menu.ts
index 0d546873ee..93f3bb8539 100644
--- a/src/lib/simple-model-menu.ts
+++ b/src/lib/simple-model-menu.ts
@@ -84,8 +84,6 @@ export interface SimpleMenuInput {
probing: ReadonlySet<string>;
loading: boolean;
refreshing?: string | null;
- /** Picking a model also changes the bot's own model, not just this conversation's. */
- updatesBotDefault?: boolean;
}
export function providerName(instance: InstanceInfo): string {
@@ -153,7 +151,7 @@ function currentRow(input: SimpleMenuInput): MenuCurrent {
if (active.policy) return { ...row, meta: t("policy.managedBy", { organization: active.policy.organizationName }), warning: true };
if (needsCli(active)) return { ...row, meta: t("model.setupRequired"), warning: true };
if (needsSignIn(active) && !isCustomOnly(active) && !option?.custom) return { ...row, meta: t("model.signInRequired"), warning: true };
- if (bot.follows === true) return { ...row, meta: t(input.updatesBotDefault ? "model.simple.botsModelScope" : "model.simple.botsModel", { name: bot.name }) };
+ if (bot.follows === true) return { ...row, meta: t("model.simple.botsModel", { name: bot.name }) };
const family = signInFamily(active);
const accounts = family ? instances.filter((instance) => signInFamily(instance) === family).length : 0;
if (accounts > 1 || active.snapshot.chatgptPlan) return { ...row, meta: engineDisplayName(active) };
diff --git a/src/locales/en.json b/src/locales/en.json
index 5a6056a081..a4bb1dcda2 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -3464,7 +3464,6 @@
"model.simple.signInForOwn": "Sign in for {name}'s own models",
"model.simple.reasoning": "Reasoning",
"model.simple.botsModel": "{name}'s model",
- "model.simple.botsModelScope": "{name}'s model, used in all its chats",
"model.simple.unavailable": "Unavailable",
"model.orgBlocked": "Turned off by your organization",
"model.simple.signIn": "Sign in",
@@ -3683,6 +3682,7 @@
"model.section.default": "Default model",
"model.section.starting": "Starting model for the new bot and its threads.",
"model.section.threads": "For groups and every thread that uses the bot's model. A thread keeps its own model only when you pick one in it.",
+ "model.section.newThreads": "New threads start on {model}, the model last picked in a thread. Picking a model here changes that too.",
"model.section.installationDefault": "A new bot starts on this installation's default model unless you pick another here. To switch automatically when this model is at its usage limit, add backup models below.",
"model.section.effort": "Effort",
"model.section.startingReasoning": "Starting reasoning variant for the new bot.",
@@ -3720,11 +3720,6 @@
"model.variant.clearHint": "Send no thinking selection; the agent keeps its session or configured setting",
"model.variant.clear": "Clear variant selection",
"model.variant.use": "Use {variant} for this model",
- "model.scope.label": "Apply model changes to",
- "model.scope.bot": "Thread + bot default",
- "model.scope.thread": "Only this thread",
- "model.scope.botHelp": "The bot's model: this thread, groups, and every thread that uses the bot's model.",
- "model.scope.threadHelp": "This thread only. It keeps this model when the bot's model changes.",
"permissions.cannotCoordinate": "This model cannot contact other bots",
"permissions.openSystemSettings": "Open System Settings",
"permissions.chief.title": "Chief of Staff",
diff --git a/src/locales/it.json b/src/locales/it.json
index 88bb11fe13..9ba3c7339a 100644
--- a/src/locales/it.json
+++ b/src/locales/it.json
@@ -3430,7 +3430,6 @@
"model.simple.signInForOwn": "Accedi per i modelli propri di {name}",
"model.simple.reasoning": "Ragionamento",
"model.simple.botsModel": "{name} modello",
- "model.simple.botsModelScope": "{name} modello, usato in tutte le sue chat",
"model.simple.unavailable": "Non disponibile",
"model.orgBlocked": "Disattivato dalla vostra organizzazione",
"model.simple.signIn": "Firma",
@@ -3686,11 +3685,6 @@
"model.variant.clearHint": "Non inviare una scelta di ragionamento; l'agente mantiene l'impostazione di sessione o quella configurata",
"model.variant.clear": "Azzera la scelta della variante",
"model.variant.use": "Usa {variant} per questo modello",
- "model.scope.label": "Applica le modifiche al modello a",
- "model.scope.bot": "Conversazione + predefinito bot",
- "model.scope.thread": "Solo questa conversazione",
- "model.scope.botHelp": "Il modello del bot: questa conversazione, i gruppi e ogni conversazione che usa il modello del bot.",
- "model.scope.threadHelp": "Solo questa conversazione. Tiene questo modello quando cambia quello del bot.",
"permissions.cannotCoordinate": "Questo modello non può contattare altri bot",
"permissions.openSystemSettings": "Impostazioni di sistema aperte",
"permissions.chief.title": "Assistente principale",
diff --git a/src/locales/ja.json b/src/locales/ja.json
index a83ba06c77..bf3148dbf4 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -3035,11 +3035,6 @@
"model.variant.clearHint": "思考設定を送信しません。エージェントは現在のセッション設定または構成済みの設定を保持します",
"model.variant.clear": "バリアントの選択を解除",
"model.variant.use": "このモデルに{variant}を使用",
- "model.scope.label": "モデル変更の適用範囲",
- "model.scope.bot": "スレッド + ボットの既定",
- "model.scope.thread": "このスレッドのみ",
- "model.scope.botHelp": "ボットのモデル:このスレッド、グループ、およびボットのモデルを使用するすべてのスレッドに適用されます。",
- "model.scope.threadHelp": "このスレッドのみに適用されます。ボットのモデルが変更されても、このモデルが維持されます。",
"permissions.cannotCoordinate": "このモデルは他のボットに連絡できません",
"permissions.openSystemSettings": "システム設定を開く",
"permissions.chief.title": "Chief of Staff",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 12fe1a5a39..5ffb44ad65 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -2902,11 +2902,6 @@
"model.variant.clearHint": "사고 설정을 보내지 않아요. 에이전트는 세션 설정이나 구성된 설정을 유지해요",
"model.variant.clear": "변형 선택 해제",
"model.variant.use": "이 모델에 {variant} 사용",
- "model.scope.label": "모델 변경 적용 범위",
- "model.scope.bot": "스레드 + 봇 기본값",
- "model.scope.thread": "이 스레드만",
- "model.scope.botHelp": "봇의 모델: 이 스레드, 그룹, 봇의 모델을 쓰는 모든 스레드.",
- "model.scope.threadHelp": "이 스레드만 적용돼요. 봇의 모델이 바뀌어도 이 모델을 유지해요.",
"permissions.cannotCoordinate": "이 모델은 다른 봇에게 연락할 수 없어요",
"permissions.openSystemSettings": "시스템 설정 열기",
"permissions.chief.title": "비서실장",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index b8310aad6d..1ebfc9f51a 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -2697,11 +2697,6 @@
"model.variant.clearHint": "Nie wysyłaj wyboru myślenia; agent zachowa ustawienie sesji lub skonfigurowaną wartość",
"model.variant.clear": "Wyczyść wybór wariantu",
"model.variant.use": "Użyj wariantu {variant} dla tego modelu",
- "model.scope.label": "Zastosuj zmiany modelu do",
- "model.scope.bot": "Wątek + ustawienie domyślne bota",
- "model.scope.thread": "Tylko ten wątek",
- "model.scope.botHelp": "Model bota: ten wątek, grupy i każdy wątek korzystający z modelu bota.",
- "model.scope.threadHelp": "Tylko ten wątek. Zachowuje ten model, gdy model bota się zmienia.",
"permissions.cannotCoordinate": "Ten model nie może kontaktować się z innymi botami",
"permissions.chief.title": "Szef sztabu",
"permissions.chief.oneFor": "Jeden dla: {section}",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index ea9aaf9f7e..56be1ec02e 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -3265,7 +3265,6 @@
"model.simple.signInForOwn": "Entrar para usar os próprios modelos de {name}",
"model.simple.reasoning": "Raciocínio",
"model.simple.botsModel": "Modelo de {name}",
- "model.simple.botsModelScope": "Modelo de {name}, usado em todas as conversas dele",
"model.simple.unavailable": "Indisponível",
"model.orgBlocked": "Desligado pela sua organização",
"model.simple.signIn": "Entrar",
@@ -3484,6 +3483,7 @@
"model.section.default": "Modelo padrão",
"model.section.starting": "Modelo inicial para o novo bot e suas conversas.",
"model.section.threads": "Para grupos e todas as conversas que usam o modelo do bot. Uma conversa mantém seu próprio modelo somente quando você escolhe um nela.",
+ "model.section.newThreads": "Novas conversas começam em {model}, o último modelo escolhido em uma conversa. Escolher um modelo aqui também muda isso.",
"model.section.installationDefault": "Um novo bot começa com o modelo padrão desta instalação, a menos que você escolha outro aqui. Para trocar automaticamente quando esse modelo atingir o limite de uso, adicione modelos de reserva abaixo.",
"model.section.effort": "Esforço",
"model.section.startingReasoning": "Variante inicial de raciocínio para o novo bot.",
@@ -3517,11 +3517,6 @@
"model.variant.clearHint": "Não enviar uma variante de raciocínio; o agente mantém o ajuste da sessão ou o que já estiver configurado",
"model.variant.clear": "Limpar seleção de variante",
"model.variant.use": "Usar {variant} para este modelo",
- "model.scope.label": "Aplicar alterações do modelo a",
- "model.scope.bot": "Conversa + padrão do bot",
- "model.scope.thread": "Somente esta conversa",
- "model.scope.botHelp": "Modelo do bot: esta conversa, grupos e todas as conversas que usam o modelo do bot.",
- "model.scope.threadHelp": "Somente esta conversa. Ela mantém este modelo quando o modelo do bot mudar.",
"permissions.cannotCoordinate": "Este modelo não pode entrar em contato com outros bots",
"permissions.openSystemSettings": "Abrir os Ajustes do Sistema",
"permissions.chief.title": "Chefe de gabinete",
diff --git a/src/locales/ru.json b/src/locales/ru.json
index e701dc97bb..b5744c998d 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -2729,11 +2729,6 @@
"model.variant.clearHint": "Не отправлять выбор варианта: OpenCode сохранит текущую сессию или настроенный параметр",
"model.variant.clear": "Сбросить выбор варианта",
"model.variant.use": "Использовать {variant} для этой модели",
- "model.scope.label": "Применить изменение модели к",
- "model.scope.bot": "Тред + модель бота по умолчанию",
- "model.scope.thread": "Только этот тред",
- "model.scope.botHelp": "Модель бота: этот тред, группы и все треды, использующие модель бота.",
- "model.scope.threadHelp": "Только этот тред. Он сохранит эту модель, даже если модель бота изменится.",
"permissions.cannotCoordinate": "Эта модель не может связываться с другими ботами",
"permissions.chief.title": "Начальник штаба",
"permissions.chief.oneFor": "Один для {section}",
diff --git a/src/locales/source-hashes.json b/src/locales/source-hashes.json
index df0d226b4f..def9ca494a 100644
--- a/src/locales/source-hashes.json
+++ b/src/locales/source-hashes.json
@@ -21848,11 +21848,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
"permissions.chief.oneFor": "a5b6716be280dfee4b86cc7aa4d6a4b2bbdde3ce7f2161976e445455ebd1d2c5",
@@ -31002,11 +30997,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.openSystemSettings": "18196b39b44de54ac56110e77207ad61e1d8bb3198c1649d36c3ae12f8df6768",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
@@ -37697,7 +37687,6 @@
"sidebar.newConversationWith": "980cf3e4baa59749dbe29ac4960fccb0ec6a5278903cdef15e4afae74657c2ac",
"inbox.emptyHint": "0105954275918cda7ea87a1d942173015f96aaf820ba74a4bd07386d6426b4d8",
"chat.openBotPanel": "1f9ede9056d58ca37a4f7f79dd7da5226a8f30d0f1b616ac7eaaca6dcebaccbf",
- "model.simple.botsModelScope": "c82c64a1fc353ed97f01626c16baf213f73cc6c0859519653ec5eaea9608bbee",
"model.simple.auto": "0286249762f7c94349cdc0ba3bb2255baf9a80036e2193ead1d77696f888582f",
"model.simple.thinkingAuto": "1d0caa99d3ed5904336835bfcf2966ed4d0b76486100da2f725dea4b580fbcc7",
"model.simple.effortHint.none": "55a20fa5220bf26aa8762241df3dfb36f421390668b629feb585e07bef8a35fa",
@@ -45249,11 +45238,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.openSystemSettings": "18196b39b44de54ac56110e77207ad61e1d8bb3198c1649d36c3ae12f8df6768",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
@@ -51492,7 +51476,6 @@
"attach.besideAria": "32466e6fbbeff02d39416b7ef5428a28865719a4185e8f3be00fcd1675dacd81",
"attach.besideClose": "7d8ab368210c5ae8d2cec7bb577afe1e7cf9489c88f031e0f9de7555c9f20b66",
"model.effort.ultra": "ac364e1afdd79d8df7004bcf37e54097efac65ae763dff941dc65febfdcb1cec",
- "model.simple.botsModelScope": "c82c64a1fc353ed97f01626c16baf213f73cc6c0859519653ec5eaea9608bbee",
"model.simple.auto": "0286249762f7c94349cdc0ba3bb2255baf9a80036e2193ead1d77696f888582f",
"model.simple.thinkingAuto": "1d0caa99d3ed5904336835bfcf2966ed4d0b76486100da2f725dea4b580fbcc7",
"model.simple.effortHint.none": "55a20fa5220bf26aa8762241df3dfb36f421390668b629feb585e07bef8a35fa",
@@ -58650,11 +58633,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.openSystemSettings": "18196b39b44de54ac56110e77207ad61e1d8bb3198c1649d36c3ae12f8df6768",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
@@ -62461,7 +62439,6 @@
"chat.engineCompactionTitle": "c14d1d11357041f33e8a5105514f375c446ec70e678e3ef86830f20fcd14811c",
"chat.engineCompactionHint": "c4d692c9695018e3ec3688d5e43578daeb2d185548ebf369b1efeb8309bd9f28",
"chat.openBotPanel": "1f9ede9056d58ca37a4f7f79dd7da5226a8f30d0f1b616ac7eaaca6dcebaccbf",
- "model.simple.botsModelScope": "c82c64a1fc353ed97f01626c16baf213f73cc6c0859519653ec5eaea9608bbee",
"model.simple.auto": "0286249762f7c94349cdc0ba3bb2255baf9a80036e2193ead1d77696f888582f",
"model.simple.thinkingAuto": "1d0caa99d3ed5904336835bfcf2966ed4d0b76486100da2f725dea4b580fbcc7",
"model.simple.effortHint.none": "55a20fa5220bf26aa8762241df3dfb36f421390668b629feb585e07bef8a35fa",
@@ -84779,11 +84756,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
"permissions.chief.oneFor": "a5b6716be280dfee4b86cc7aa4d6a4b2bbdde3ce7f2161976e445455ebd1d2c5",
@@ -92306,11 +92278,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
"permissions.chief.oneFor": "a5b6716be280dfee4b86cc7aa4d6a4b2bbdde3ce7f2161976e445455ebd1d2c5",
@@ -99811,11 +99778,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
"permissions.chief.oneFor": "a5b6716be280dfee4b86cc7aa4d6a4b2bbdde3ce7f2161976e445455ebd1d2c5",
@@ -105494,7 +105456,6 @@
"sidebar.pinnedThreads.item": "6c6884135954b91cbce059fe8fa633a82d0f4b4afc40c9c3642c425139eca3c4",
"model.effort.max": "a1a5936d3b0f8a69fd62c91ed9990d3bd414c5e78c603e2837c65c9f46a93eb8",
"model.simple.botsModel": "0fa605a09f33a0087c8c330c33e4b4e95a1474c41146db3bd8e72eef0cb6dac3",
- "model.simple.botsModelScope": "c82c64a1fc353ed97f01626c16baf213f73cc6c0859519653ec5eaea9608bbee",
"model.simple.unavailable": "ca184496974204a0bd3fd4925e0540bc4b0df6fcc232994d29754272b7183812",
"model.orgBlocked": "ba5ec24678b71d2e6f241fce7ecce15154440e448e9b398143818559a349162e",
"model.simple.signIn": "bfd402b2f6f3812529b55596136d3a11c51616317e3b1cd999928e2d4eae7d3f",
@@ -112651,11 +112612,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.openSystemSettings": "18196b39b44de54ac56110e77207ad61e1d8bb3198c1649d36c3ae12f8df6768",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
@@ -121665,7 +121621,6 @@
"model.simple.signInForOwn": "91c24d772ec5d7da94a37187d389728677f05dd9cb51251ff5c0adfc2b64f5c0",
"model.simple.reasoning": "d8211e24e83d1600a1b0cfe2f7baa68e4d4eb71131a0b2b1b2050cba111ea481",
"model.simple.botsModel": "0fa605a09f33a0087c8c330c33e4b4e95a1474c41146db3bd8e72eef0cb6dac3",
- "model.simple.botsModelScope": "c82c64a1fc353ed97f01626c16baf213f73cc6c0859519653ec5eaea9608bbee",
"model.simple.unavailable": "ca184496974204a0bd3fd4925e0540bc4b0df6fcc232994d29754272b7183812",
"model.orgBlocked": "ba5ec24678b71d2e6f241fce7ecce15154440e448e9b398143818559a349162e",
"model.simple.signIn": "bfd402b2f6f3812529b55596136d3a11c51616317e3b1cd999928e2d4eae7d3f",
@@ -121921,11 +121876,6 @@
"model.variant.clearHint": "62d8d7b51ff3512769269e90ae3fa4c592db125f374c80226258bb7e3adad951",
"model.variant.clear": "0c17f853e92c17e383b57d08db61d61776da21983507d5726d0e34343288d876",
"model.variant.use": "dd6e1ccb0bcff97613c263e21891c8a689139b93a57c96c89cb6795ad874df79",
- "model.scope.label": "a32914db34d954eed826e05360169380f28381be07a3257528ea070287236c55",
- "model.scope.bot": "d8dbd942524de471a3440878b7dded08e2a5ec4edb03d76f99bd2ff65511bf29",
- "model.scope.thread": "5090b7973086fce393940ad6a9389e5ba1aac6d461a1d71349f29509ef1cc5f6",
- "model.scope.botHelp": "68fe68862fe69ffc3d0521e912f477ef7afed0e104193cc784540f1a12db6394",
- "model.scope.threadHelp": "6003effce7e18c86192eaae676cfce59d3cba5529e53e0867c0df91799136105",
"permissions.cannotCoordinate": "2a02ec6dd541e2888dc834d5f3a0a78c1d0545c3c8d5b1b0623f820b6441c515",
"permissions.openSystemSettings": "18196b39b44de54ac56110e77207ad61e1d8bb3198c1649d36c3ae12f8df6768",
"permissions.chief.title": "245b630a86a9f2753c86a86f1a9cdeaed80b74704dfa2fc3193d6e312c294a38",
diff --git a/src/locales/th.json b/src/locales/th.json
index 880fc8bcd4..8dbe9209fe 100644
--- a/src/locales/th.json
+++ b/src/locales/th.json
@@ -3422,7 +3422,6 @@
"model.simple.signInForOwn": "ลงชื่อเข้าใช้เพื่อใช้โมเดลของ {name} เอง",
"model.simple.reasoning": "การใช้เหตุผล",
"model.simple.botsModel": "โมเดลของ {name}",
- "model.simple.botsModelScope": "โมเดลของ {name} ที่ใช้ในทุกแชตของบอท",
"model.simple.unavailable": "ไม่พร้อมใช้งาน",
"model.orgBlocked": "องค์กรของคุณปิดไว้",
"model.simple.signIn": "ลงชื่อเข้าใช้",
@@ -3678,11 +3677,6 @@
"model.variant.clearHint": "ไม่ส่งตัวเลือกการคิด ให้เอเจนต์ใช้การตั้งค่าเซสชันหรือค่าที่กำหนดไว้",
"model.variant.clear": "ล้างตัวเลือก",
"model.variant.use": "ใช้ {variant} กับโมเดลนี้",
- "model.scope.label": "ใช้การเปลี่ยนโมเดลกับ",
- "model.scope.bot": "เธรดและค่าเริ่มต้นของบอท",
- "model.scope.thread": "เธรดนี้เท่านั้น",
- "model.scope.botHelp": "โมเดลของบอท: เธรดนี้ แชตกลุ่ม และทุกเธรดที่ใช้โมเดลของบอท",
- "model.scope.threadHelp": "เธรดนี้เท่านั้น เมื่อโมเดลของบอทเปลี่ยน เธรดนี้ยังคงใช้โมเดลนี้",
"permissions.cannotCoordinate": "โมเดลนี้ติดต่อบอทตัวอื่นไม่ได้",
"permissions.openSystemSettings": "เปิดการตั้งค่าระบบ",
"permissions.chief.title": "หัวหน้าทีม",
diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json
index cb2dab403a..1e02cc259e 100644
--- a/src/locales/zh-tw.json
+++ b/src/locales/zh-tw.json
@@ -3212,11 +3212,6 @@
"model.variant.clearHint": "不傳送思考選擇;代理會保留其工作階段或已設定的設定",
"model.variant.clear": "清除變體選擇",
"model.variant.use": "此模型使用 {variant}",
- "model.scope.label": "將模型變更套用至",
- "model.scope.bot": "對話 + 機器人預設",
- "model.scope.thread": "僅此對話",
- "model.scope.botHelp": "機器人的模型:這個對話、群組,以及每個使用機器人模型的對話。",
- "model.scope.threadHelp": "僅此對話。機器人的模型變更時,它仍保留這個模型。",
"permissions.cannotCoordinate": "這個模型無法聯絡其他機器人",
"permissions.openSystemSettings": "開啟系統設定",
"permissions.chief.title": "幕僚長",
@@ -9751,7 +9746,6 @@
"chat.engineCompactionTitle": "對話已整理成摘要",
"chat.engineCompactionHint": "AI 已將較早的訊息整理成摘要以騰出空間。完整對話仍會保留,但機器人可能無法準確記住較早的細節。",
"chat.openBotPanel": "詳細資料與對話",
- "model.simple.botsModelScope": "{name} 的模型,套用於它的所有聊天",
"model.simple.auto": "自動",
"model.simple.thinkingAuto": "建議選項。系統會依每則訊息自動選擇投入程度。",
"model.simple.effortHint.none": "不進行額外思考,回覆速度最快。",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 8c792bd53d..2ac286b6e8 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -3419,7 +3419,6 @@
"model.simple.signInForOwn": "登录以使用 {name} 自己的模型",
"model.simple.reasoning": "推理",
"model.simple.botsModel": "{name} 的模型",
- "model.simple.botsModelScope": "{name} 的模型,用于它的所有聊天",
"model.simple.unavailable": "不可用",
"model.orgBlocked": "已被你的组织关闭",
"model.simple.signIn": "登录",
@@ -3675,11 +3674,6 @@
"model.variant.clearHint": "不发送思考选项,由智能体沿用其会话或已配置的设置",
"model.variant.clear": "清除变体选择",
"model.variant.use": "为此模型使用 {variant}",
- "model.scope.label": "应用模型更改到",
- "model.scope.bot": "对话 + 机器人默认",
- "model.scope.thread": "仅此对话",
- "model.scope.botHelp": "使用机器人的模型:此对话、群组聊天,以及所有使用机器人模型的对话。",
- "model.scope.threadHelp": "仅此对话。机器人模型更改时,它仍保留这个模型。",
"permissions.cannotCoordinate": "此模型无法联系其他机器人",
"permissions.openSystemSettings": "打开系统设置",
"permissions.chief.title": "幕僚长",
diff --git a/src/state/new-chat.test.ts b/src/state/new-chat.test.ts
index 7568b498b4..d0baca0ad6 100644
--- a/src/state/new-chat.test.ts
+++ b/src/state/new-chat.test.ts
@@ -381,3 +381,19 @@ describe("a new conversation opens blank and is made by its first send", () => {
expect(sends[0]).toMatchObject({ threadId: "made", text: "Hello" });
});
});
+
+describe("a blank chat's model", () => {
+ const blank = { session: 1, botId: "bot", held: [] };
+ const opus = { instanceId: "fake", model: "opus" };
+
+ it("is the model new threads start on: the bot's last thread pick, else the bot's own", () => {
+ expect(newChatBot(bot("a", ["a"]), blank).modelSelection).toEqual({ instanceId: "fake", model: "fixture" });
+ expect(newChatBot({ ...bot("a", ["a"]), newThreadModel: opus }, blank).modelSelection).toEqual(opus);
+ });
+
+ it("is the pick made in the blank chat once there is one", () => {
+ const haiku = { instanceId: "fake", model: "haiku" };
+ const held = [{ type: "setModel" as const, botId: "bot", threadId: DRAFT, selection: haiku }];
+ expect(newChatBot({ ...bot("a", ["a"]), newThreadModel: opus }, { ...blank, held }).modelSelection).toEqual(haiku);
+ });
+});
diff --git a/src/state/new-chat.ts b/src/state/new-chat.ts
index 4286e7a51b..a55c86f1a4 100644
--- a/src/state/new-chat.ts
+++ b/src/state/new-chat.ts
@@ -34,7 +34,7 @@ export function reduceNewChat(state: AppState, action: Action): [state: AppState
export function newChatBot(bot: Bot, open: NewChat | null | undefined): Bot {
if (open?.botId !== bot.id) return bot;
let shown: Bot = {
- ...bot, threadId: newChatThreadId(bot.id), messages: [], activeLeafId: null, hasMore: false, busy: false, activity: undefined,
+ ...bot, modelSelection: bot.newThreadModel ?? bot.modelSelection, threadId: newChatThreadId(bot.id), messages: [], activeLeafId: null, hasMore: false, busy: false, activity: undefined,
turnStartedAt: null, waitingForTeammates: false, pinnedMessageId: undefined, awaitingThreadSnapshot: false, switchingTo: undefined,
};
for (const held of open.held) {
diff --git a/src/state/store.tsx b/src/state/store.tsx
index f9fe3ca7d3..b005d5c8ca 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -274,7 +274,7 @@ export interface TaskUsage {
context?: { tokens: number; window?: number };
}
-export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" | "mascotBodyColor" | "mascotMaterial" | "access" | "yourAccess" | "onlyPeopleAdded" | "voicePlaybackRate" | "liveOverride"> {
+export interface Bot extends DefaultBotFields, Pick<WireBot, "mascotFaceColor" | "mascotBodyColor" | "mascotMaterial" | "access" | "yourAccess" | "onlyPeopleAdded" | "voicePlaybackRate" | "liveOverride" | "newThreadModel"> {
toolScope?: ToolScope;
waitingForTeammates?: boolean;
id: string;