Skip to content

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

fix(companion): let a paired desktop change a bot's model (#4219)

Aditya Umale9ebb4c2199b3
diff --git a/src/components/ChatView.controls.test.ts b/src/components/ChatView.controls.test.ts
index 5432715aae..95ff2674a8 100644
--- a/src/components/ChatView.controls.test.ts
+++ b/src/components/ChatView.controls.test.ts
@@ -91,12 +91,14 @@ describe("the header's right side", () => {
}
});
- it("keeps the computer and ⋯ in a remote client's Simple header, whose settings panel has no room for them", () => {
+ it("keeps the model, the computer and ⋯ in a remote client's Simple header, whose settings panel has no room for them", () => {
fixture.advanced = false;
window.ogb = { remoteClient: { active: true } } as NonNullable<Window["ogb"]>;
try {
const { markup } = header();
- expect(markup).not.toContain("data-test-model-control");
+ // The host checks the model against its own catalog, so a paired desktop can change it like the phone can.
+ expect(markup).toContain("data-test-model-control");
+ expect(fixture.model).toMatchObject({ bot: { id: "bot" }, threadId: "selected" });
expect(markup).toContain('data-tour="computer"');
expect(markup).toContain('data-testid="chat-more"');
const more = fixture.menus.find((menu) => menu.ariaLabel === "More")!;
@@ -613,12 +615,17 @@ describe("thread control placement", () => {
expect(fixture.dispatch).toHaveBeenLastCalledWith({ type: "updateTask", botId: "bot", threadId: "selected", patch: { approvalMode: "full" } });
});
- it("keeps both controls hidden for remote clients", () => {
+ it("offers remote clients the model picker but keeps approval changes on the host", () => {
window.ogb = { remoteClient: { active: true } } as NonNullable<Window["ogb"]>;
- const markup = renderToStaticMarkup(createElement(ChatView, { bot }));
- expect(markup).not.toContain("data-test-model-control");
- expect(markup).not.toContain("data-test-approval-control");
- delete window.ogb;
+ try {
+ fixture.model = null;
+ const markup = renderToStaticMarkup(createElement(ChatView, { bot }));
+ expect(markup).toContain("data-test-model-control");
+ expect(fixture.model).toMatchObject({ bot: { id: "bot" }, threadId: "selected" });
+ expect(markup).not.toContain("data-test-approval-control");
+ } finally {
+ delete window.ogb;
+ }
});
it.each([true, false])("pins a place per conversation from the composer only in Advanced (advanced: %s)", (advanced) => {
diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx
index 5016d31c9e..a5e595cb19 100644
--- a/src/components/ChatView.tsx
+++ b/src/components/ChatView.tsx
@@ -1115,7 +1115,7 @@ export function ChatView({ bot: profile }: { bot: Bot }) {
<ThreadContextWarning bot={bot} messages={messages} />
<EngineLimitNotice engine={bot.modelSelection?.instanceId} />
{/* The model and the bot's computer stay in view in both modes; Simple mode moves only ⋯ into the bot panel. */}
- {!remoteClient && !phone && <ModelPicker key={bot.threadId} bot={bot} threadId={bot.threadId} />}
+ {!phone && <ModelPicker key={bot.threadId} bot={bot} threadId={bot.threadId} />}
<LiveCallChip currentBotId={bot.id} onOpen={(botId, threadId) => openThread(dispatch, { botId, threadId }, state, showThreads)} />
{!phoneMenu && <button
data-tour="computer"
diff --git a/src/components/EngineSetup.tsx b/src/components/EngineSetup.tsx
index cf30de8f5a..ae83d37005 100644
--- a/src/components/EngineSetup.tsx
+++ b/src/components/EngineSetup.tsx
@@ -492,6 +492,7 @@ export function EngineSetup({
unframed = false,
description: descriptionOverride,
quiet = false,
+ onHost = false,
}: {
instance: InstanceInfo;
className?: string;
@@ -499,6 +500,8 @@ export function EngineSetup({
unframed?: boolean;
description?: string;
quiet?: boolean;
+ /** A paired desktop: sign-in and setup happen on the host, whose AIs it uses. */
+ onHost?: boolean;
}) {
const { state } = useStore();
const cloudHome = state.config?.cloudHome === true;
@@ -534,6 +537,16 @@ export function EngineSetup({
? t("engineSetup.installDescSignIn")
: t("engineSetup.installDesc"));
+ // The host does not open its sign-in and setup calls to a paired desktop, so point the person there instead.
+ if (onHost) {
+ return (
+ <div data-engine-setup-on-host className={cn(!unframed && "rounded-xl border border-hairline/40 bg-control/30 p-3", className)}>
+ <div className="text-[13px] font-semibold text-ink">{title}</div>
+ <p className="mt-1 text-[12px] leading-relaxed text-ink-secondary">{t("remote.client.setUpOnHost", { name: instance.displayName })}</p>
+ </div>
+ );
+ }
+
if (apiKeySetup(instance)) {
return <ApiKeyEngineSetup instance={instance} className={className} unframed={unframed} />;
}
diff --git a/src/components/ModelPicker.ai-switch.test.ts b/src/components/ModelPicker.ai-switch.test.ts
index dde07f6f68..60aba20136 100644
--- a/src/components/ModelPicker.ai-switch.test.ts
+++ b/src/components/ModelPicker.ai-switch.test.ts
@@ -106,6 +106,20 @@ describe("the header model chip and Switch AI", () => {
expect(document.querySelector("[data-simple-effort]")).not.toBeNull();
});
+ it("asks before a thread-only switch when the thread, not the bot, is on Custom permissions", () => {
+ const bot = { ...busyBot, busy: false, approvalMode: "ask",
+ tasks: [{ threadId: "thread-1", approvalMode: "custom", modelSelection: busyBot.modelSelection }] } as unknown as Bot;
+ act(() => root.render(createElement(ModelPicker, { bot, threadId: "thread-1" })));
+ act(() => trigger().click());
+ act(() => buttonNamed("OpenAI")!.click());
+ act(() => buttonNamed("GPT-5.6")!.click());
+ expect(document.body.textContent).toContain("Switch model with Ask permissions?");
+ const setModels = () => vi.mocked(fixture.dispatch).mock.calls.filter(([action]) => (action as { type: string }).type === "setModel");
+ expect(setModels()).toEqual([]);
+ act(() => buttonNamed("Switch with Ask")!.click());
+ expect(setModels()).toEqual([[expect.objectContaining({ threadId: "thread-1", resetApprovalToAsk: true })]]);
+ });
+
it("ignores an intent for another place", () => {
act(() => requestAiSwitch({ botId: "maus", threadId: "thread-1", turnId: "turn-1", place: "panel" }));
expect(trigger().disabled).toBe(true);
diff --git a/src/components/ModelPicker.interaction.test.ts b/src/components/ModelPicker.interaction.test.ts
index c38230ee04..f6a26216a2 100644
--- a/src/components/ModelPicker.interaction.test.ts
+++ b/src/components/ModelPicker.interaction.test.ts
@@ -165,6 +165,19 @@ describe("ModelPicker with a signed-out or missing Claude", () => {
expect(html).not.toContain("No model providers are available.");
});
+ it("on a paired desktop, sends a signed-out provider's sign-in to the host instead of offering one that cannot run", () => {
+ fixture.instances = [signedOut()];
+ window.ogb = { remoteClient: { active: true } } as NonNullable<Window["ogb"]>;
+ try {
+ const html = menu(open(bot("claude", "claude-opus-5-5")).html);
+ expect(html).toContain("data-engine-setup-on-host");
+ expect(html).toContain("Set up Claude there");
+ expect(html).not.toContain("data-claude-sign-in");
+ } finally {
+ delete window.ogb;
+ }
+ });
+
it("keeps the bot's own Claude with its install card when the CLI is not found", () => {
fixture.instances = [codex, notFound()];
const html = open(bot("claude", "claude-opus-5-5")).html;
diff --git a/src/components/ModelPicker.simple.test.ts b/src/components/ModelPicker.simple.test.ts
index b4d37eaf65..b8cb780b01 100644
--- a/src/components/ModelPicker.simple.test.ts
+++ b/src/components/ModelPicker.simple.test.ts
@@ -983,6 +983,28 @@ describe("every capability of the picker stays reachable", () => {
expect(list(onMissing).current).toMatchObject({ meta: "Setup required", warning: true });
});
+ it.each([false, true])("on a paired desktop (Advanced: %s), still picks models but leaves provider settings to the host", (advanced) => {
+ fixture.advanced = advanced;
+ fixture.instances = rich();
+ const forBot = followed();
+ window.ogb = { remoteClient: { active: true } } as NonNullable<Window["ogb"]>;
+ try {
+ const html = menu(open(forBot).html);
+ expect(html).toContain("Sonnet 5.5");
+ for (const hostOnly of ["data-simple-manage", "Model providers and accounts", "data-model-add-api-keys"]) {
+ expect(html, hostOnly).not.toContain(hostOnly);
+ }
+ // Nothing follows the thinking levels, so no divider hangs under them.
+ if (!advanced) {
+ const band = region(html, "data-simple-effort-band");
+ expect(band).toContain(">X-High</button>");
+ expect(band).not.toContain('role="separator"');
+ }
+ } finally {
+ delete window.ogb;
+ }
+ });
+
it("in Advanced mode, from the chip and the full picker", () => {
fixture.advanced = true;
fixture.instances = [updated, signedOutWork, codex, plan, managed, local];
diff --git a/src/components/ModelPicker.tsx b/src/components/ModelPicker.tsx
index 1062ca3acc..d078e92412 100644
--- a/src/components/ModelPicker.tsx
+++ b/src/components/ModelPicker.tsx
@@ -483,7 +483,7 @@ export function ModelPicker({
const nextSelection = modelSelectionForPick(selection, instance, model);
if (variant !== undefined) nextSelection.variant = variant;
const updateBotDefault = !threadId || (simpleView ? simpleUpdatesBotDefault : scope === "bot");
- const targets = updateBotDefault ? [currentTaskBot(profile, threadId ?? bot.threadId), profile] : [bot];
+ 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,
instance.driverKind))) {
@@ -803,8 +803,8 @@ export function ModelPicker({
</div>
) : blocked ? (
<div className="min-h-0 flex-1 overflow-y-auto px-2 pb-3 pt-1">
- <EngineSetup instance={railInstance} intent={pane === "custom" ? "inject" : "cloud"} quiet={!advanced} />
- {railInstance.claudeAccount && needsSignIn(railInstance) && pane !== "custom" && (
+ <EngineSetup instance={railInstance} intent={pane === "custom" ? "inject" : "cloud"} quiet={!advanced} onHost={remote} />
+ {!remote && railInstance.claudeAccount && needsSignIn(railInstance) && pane !== "custom" && (
<p className="mt-2 px-1.5 text-[12px] leading-4 text-ink-tertiary">
{railInstance.claudeAccount.signInShell === "powershell" && `${t("engines.account.powershell")} `}
{t("engines.account.signInHint")}
@@ -931,19 +931,19 @@ export function ModelPicker({
) : (
<div className="px-3.5 py-5 text-[13px] leading-[18px] text-ink-secondary">{t("model.noProviders")}</div>
)}
- <div className="flex h-9 shrink-0 items-center gap-1 border-t-[0.5px] border-ink/10 px-1.5">
- <button type="button" onClick={openEngines}
- className="h-7 min-w-0 flex-1 truncate rounded-md px-2 text-left text-[12px] leading-4 text-ink-secondary hover:bg-ink/[0.06] hover:text-ink">
- {t("settings.engines.title")}
- </button>
- {!remote && (
+ {!remote && (
+ <div className="flex h-9 shrink-0 items-center gap-1 border-t-[0.5px] border-ink/10 px-1.5">
+ <button type="button" onClick={openEngines}
+ className="h-7 min-w-0 flex-1 truncate rounded-md px-2 text-left text-[12px] leading-4 text-ink-secondary hover:bg-ink/[0.06] hover:text-ink">
+ {t("settings.engines.title")}
+ </button>
<button type="button" data-model-add-api-keys onClick={openApiKeys}
className="flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12px] leading-4 text-ink-secondary hover:bg-ink/[0.06] hover:text-ink">
<KeyRound size={14} strokeWidth={MENU_STROKE} aria-hidden="true" />
{apiKeysLabel(pickerInstances)}
</button>
- )}
- </div>
+ </div>
+ )}
</div>
</div>
</>
@@ -997,7 +997,7 @@ export function ModelPicker({
}}
onSetUp={openFull}
onCheckAgain={(instance) => refreshModels(instance.instanceId)}
- onManage={openEngines}
+ onManage={remote ? undefined : openEngines}
onResetVariant={resetVariant}
/>
) : fullPane}
diff --git a/src/components/SimpleModelMenu.tsx b/src/components/SimpleModelMenu.tsx
index c5ed5186da..bdbc499602 100644
--- a/src/components/SimpleModelMenu.tsx
+++ b/src/components/SimpleModelMenu.tsx
@@ -23,7 +23,8 @@ export interface SimpleMenuActions {
onToggle: (instance: InstanceInfo) => void;
onSetUp: (instance: InstanceInfo, keyboard: boolean) => void;
onCheckAgain: (instance: InstanceInfo) => void;
- onManage: () => void;
+ /** Opens the provider settings; left out where they live on another computer. */
+ onManage?: () => void;
onResetVariant?: () => void;
}
@@ -287,25 +288,29 @@ export function SimpleModelMenu(props: SimpleModelMenuProps) {
</div>
</div>
- <div data-simple-effort-band className="flex shrink-0 flex-col gap-0.5 border-t-[0.5px] border-ink/10 p-1.5">
- {props.thinking && (
- <>
- <Thinking thinking={props.thinking} labelId={`${idPrefix}-thinking`} />
- <div role="separator" className={MENU_SEPARATOR} />
- </>
- )}
- {props.onResetVariant && (
- <button type="button" data-menu-row data-simple-variant-default onClick={props.onResetVariant} className={MENU_ROW}>
- <Gutter />
- <span className="min-w-0 flex-1 truncate">{t("model.variant.session")}</span>
- </button>
- )}
- <button type="button" data-menu-row data-simple-manage onClick={props.onManage} className={MENU_ROW}>
- <Gutter><Settings size={16} strokeWidth={MENU_STROKE} className={MENU_ICON} aria-hidden="true" /></Gutter>
- <span className="min-w-0 flex-1 truncate">{t("model.simple.manage")}</span>
- <Forward />
- </button>
- </div>
+ {(props.thinking || props.onResetVariant || props.onManage) && (
+ <div data-simple-effort-band className="flex shrink-0 flex-col gap-0.5 border-t-[0.5px] border-ink/10 p-1.5">
+ {props.thinking && (
+ <>
+ <Thinking thinking={props.thinking} labelId={`${idPrefix}-thinking`} />
+ {(props.onResetVariant || props.onManage) && <div role="separator" className={MENU_SEPARATOR} />}
+ </>
+ )}
+ {props.onResetVariant && (
+ <button type="button" data-menu-row data-simple-variant-default onClick={props.onResetVariant} className={MENU_ROW}>
+ <Gutter />
+ <span className="min-w-0 flex-1 truncate">{t("model.variant.session")}</span>
+ </button>
+ )}
+ {props.onManage && (
+ <button type="button" data-menu-row data-simple-manage onClick={props.onManage} className={MENU_ROW}>
+ <Gutter><Settings size={16} strokeWidth={MENU_STROKE} className={MENU_ICON} aria-hidden="true" /></Gutter>
+ <span className="min-w-0 flex-1 truncate">{t("model.simple.manage")}</span>
+ <Forward />
+ </button>
+ )}
+ </div>
+ )}
</div>
);
}
diff --git a/src/lib/ai-switch.test.ts b/src/lib/ai-switch.test.ts
index 2d3e053cc9..c45f7db5da 100644
--- a/src/lib/ai-switch.test.ts
+++ b/src/lib/ai-switch.test.ts
@@ -123,6 +123,42 @@ describe("Switch AI", () => {
expect(saves()).toEqual([["/api/bots/bot-1/tasks/thread-1", { method: "PATCH", body: JSON.stringify({ modelSelection: { instanceId: "claude", model: "opus" } }) }]]);
});
+ it("on a paired desktop, saves a switch that resets approval to Ask on the host, not through the desktop's own bridge", async () => {
+ const setMode = vi.fn();
+ window.ogb = { approvals: { setMode }, remoteClient: { active: true } } as unknown as NonNullable<Window["ogb"]>;
+ try {
+ noteRuntimeTurn(frame("turn.started", "turn-1"));
+ show(createElement(Picker, { bot: bot(true) }), createElement(Row), createElement(Keeper, { bot: bot(true) }));
+ act(() => requestAiSwitch(intent));
+ act(() => seen!.dispatch({ ...toClaude, resetApprovalToAsk: true } as Action));
+ await settle(0);
+ noteRuntimeTurn(frame("turn.completed", "turn-1"));
+ show(createElement(Row), createElement(Keeper, { bot: bot(false) }));
+ await settle();
+ expect(setMode).not.toHaveBeenCalled();
+ expect(saves()).toEqual([["/api/bots/bot-1/tasks/thread-1", { method: "PATCH",
+ body: JSON.stringify({ modelSelection: { instanceId: "claude", model: "opus" }, resetApprovalToAsk: true }) }]]);
+ } finally {
+ delete window.ogb;
+ }
+ });
+
+ it("on a paired desktop, refuses a switch that leaves Custom approval before stopping the turn", async () => {
+ window.ogb = { approvals: { setMode: vi.fn() }, remoteClient: { active: true } } as unknown as NonNullable<Window["ogb"]>;
+ try {
+ const custom = { ...bot(true), approvalMode: "custom" } as Bot;
+ noteRuntimeTurn(frame("turn.started", "turn-1"));
+ show(createElement(Picker, { bot: custom }), createElement(Row), createElement(Keeper, { bot: custom }));
+ act(() => requestAiSwitch(intent));
+ act(() => seen!.dispatch({ ...toClaude, resetApprovalToAsk: true } as Action));
+ await settle();
+ expect(api).not.toHaveBeenCalled();
+ expect(store).toHaveBeenCalledWith({ type: "error", message: expect.stringContaining("host computer") });
+ } finally {
+ delete window.ogb;
+ }
+ });
+
it("counts the idle wait from the chat going idle, whatever else of the bot changes meanwhile", async () => {
await pickClaude();
show(createElement(Row), createElement(Keeper, { bot: bot(false) }));
diff --git a/src/lib/ai-switch.ts b/src/lib/ai-switch.ts
index 7ba114809b..614343b7e1 100644
--- a/src/lib/ai-switch.ts
+++ b/src/lib/ai-switch.ts
@@ -6,8 +6,11 @@
// person, no other turn has run since, and a resend would carry all of it; otherwise Retry stays theirs to press.
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
+import { askResetBridge } from "@/lib/desktop";
+import { t } from "@/lib/i18n";
import { api } from "@/state/api";
-import type { Action, Bot, Message } from "@/state/store";
+import { currentTaskBot, type Action, type Bot, type Message } from "@/state/store";
+import { approvalModeFor } from "../../shared/approval-mode";
import { turnStartCount } from "./stop-turn";
/** How long the chat must stay idle before the switch lands: a queued message starts its turn right after the stop. */
@@ -122,7 +125,9 @@ export function useAiSwitch(input: {
dispatch: (action: Action) => {
const ours = action.type === "setModel" && action.botId === mine.botId && (action.threadId ?? bot.threadId) === mine.threadId;
const switching = ours && !sameAi(action.selection, bot.modelSelection);
- if (switching && busy) beginSwitch(mine, action, (message) => dispatch({ type: "error", message }));
+ // Leaving Custom needs the desktop bridge (a paired desktop has none): the host would refuse it after the Stop.
+ if (switching && busy && leavesCustomWithoutBridge(action, bot)) dispatch({ type: "error", message: t("model.customSwitchOnHost") });
+ else if (switching && busy) beginSwitch(mine, action, (message) => dispatch({ type: "error", message }));
// The same AI mid-turn (a thinking level, say): the server refuses any change until the turn ends.
else if (ours && busy) return;
else dispatch(action);
@@ -169,12 +174,20 @@ function resendable(waiting: Pending, bot: Bot | undefined): Message | undefined
return carried ? last : undefined;
}
+/** A switch that resets Custom approval to Ask, from a client without the trusted desktop bridge: the server refuses it. */
+export function leavesCustomWithoutBridge(action: SetModel, bot: Bot): boolean {
+ if (!action.resetApprovalToAsk || askResetBridge()) return false;
+ const targets = action.updateBotDefault ? [currentTaskBot(bot, action.threadId), bot] : [currentTaskBot(bot, action.threadId)];
+ return targets.some((target) => approvalModeFor(target) === "custom");
+}
+
/** Saves the new AI on the conversation the way the store does, so the keeper hears whether the server took it. */
async function saveSwitch(action: SetModel): Promise<unknown> {
const threadId = action.threadId!;
const { selection: modelSelection, updateBotDefault, resetApprovalToAsk } = action;
- if (resetApprovalToAsk && window.ogb?.approvals) {
- return window.ogb.approvals.setMode(action.botId, "ask", { threadId, modelSelection, updateBotDefault: Boolean(updateBotDefault) });
+ const askBridge = resetApprovalToAsk ? askResetBridge() : undefined;
+ if (askBridge) {
+ return askBridge.setMode(action.botId, "ask", { threadId, modelSelection, updateBotDefault: Boolean(updateBotDefault) });
}
const body = { modelSelection, ...(updateBotDefault ? { updateBotDefault: true } : {}), ...(resetApprovalToAsk ? { resetApprovalToAsk: true } : {}) };
const result = await api(`/api/bots/${action.botId}/tasks/${threadId}`, { method: "PATCH", body: JSON.stringify(body) }) as { bot?: unknown } | null;
diff --git a/src/lib/desktop.test.ts b/src/lib/desktop.test.ts
index d08fc45cfb..cd6ff95a70 100644
--- a/src/lib/desktop.test.ts
+++ b/src/lib/desktop.test.ts
@@ -57,3 +57,16 @@ describe("desktop capability cache", () => {
await expect(desktop.loadDesktopCapabilities()).resolves.toBe(ready);
});
});
+
+describe("the bridge that resets a switch's approval to Ask", () => {
+ it("is the desktop's own bridge, except on a paired desktop, where the host takes the switch", async () => {
+ const approvals = { setMode: vi.fn() };
+ const { askResetBridge } = await import("./desktop");
+ vi.stubGlobal("window", { ogb: { approvals } });
+ expect(askResetBridge()).toBe(approvals);
+ vi.stubGlobal("window", { ogb: { approvals, remoteClient: { active: true } } });
+ expect(askResetBridge()).toBeUndefined();
+ vi.stubGlobal("window", {});
+ expect(askResetBridge()).toBeUndefined();
+ });
+});
diff --git a/src/lib/desktop.ts b/src/lib/desktop.ts
index 1612c82424..6b85d84a7f 100644
--- a/src/lib/desktop.ts
+++ b/src/lib/desktop.ts
@@ -76,3 +76,9 @@ export function cacheDesktopCapabilities(capabilities: DesktopCapabilities): Des
cached = capabilities;
return capabilities;
}
+
+/** The desktop bridge that saves a switch with its approval reset to Ask. A paired desktop has none: its own app runs no
+ * server behind that bridge, so the host takes the switch over HTTP. */
+export function askResetBridge() {
+ return typeof window === "undefined" || window.ogb?.remoteClient?.active ? undefined : window.ogb?.approvals;
+}
diff --git a/src/locales/en.json b/src/locales/en.json
index 3f32acb9e0..e5d86d57a0 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -2829,6 +2829,7 @@
"model.busy": "Stop this bot's turn before changing its model",
"model.threadBusy": "Stop this thread's turn before changing its model",
"model.choose": "Choose model",
+ "model.customSwitchOnHost": "This thread uses Custom approval. Switch its model in the app on the host computer, so leaving Custom can be confirmed there.",
"model.providerSwitch.title": "Switch model with Ask permissions?",
"model.providerSwitch.threadBody": "Switch this thread to {model} and reset its permissions to Ask. Existing tool approvals are cleared. Your bot default and other threads stay unchanged. You can review access for the new provider afterward.",
"model.providerSwitch.botBody": "Switch the bot's model to {model}, with Ask permissions and existing tool approvals cleared for this thread and the bot. Every thread that uses the bot's model switches too, back to Ask where the new provider needs it. Threads with their own model stay as they are. You can review access for the new provider afterward.",
@@ -4365,6 +4366,7 @@
"remote.client.fallbackName": "remote {app}",
"remote.client.mode": "This app is in client mode. Bots and conversations run on the other computer; the paired-device token stays in this computer’s encrypted credential store.",
"remote.client.disconnect": "Disconnect and use this computer",
+ "remote.client.setUpOnHost": "This app uses the AIs on the host computer. Set up {name} there, then come back and pick it.",
"remote.client.hostHint": "On the host computer, open Settings → Remote access and open a pairing window over HTTPS, Tailscale, or Wi-Fi. Then enter its address and six-digit code here.",
"remote.client.hostAddress": "Host address",
"remote.client.pairingCode": "Pairing code",
diff --git a/src/state/store.tsx b/src/state/store.tsx
index 76da45cbb8..b69683e2ff 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -34,7 +34,7 @@ import type { ModelVariantOption, RuntimeEvent } from "../../shared/runtime-even
import type { MausColor, MausMotion } from "@/lib/mascot";
import type { BotAvatarCrop } from "../../shared/bot-avatar";
import { approvalModeFor, type ApprovalMode } from "../../shared/approval-mode";
-import { desktopCapabilitiesNow } from "@/lib/desktop";
+import { askResetBridge, desktopCapabilitiesNow } from "@/lib/desktop";
import { sameModelSelection } from "../../shared/thread-model";
import type { BotBodyId } from "../../shared/bot-body";
import { StoreRefContext } from "./store-ref-context";
@@ -2210,11 +2210,10 @@ export function StoreProvider({ children }: { children: ReactNode }) {
? [...taskWrites.values()].filter((write) => write.botId === botId) : [];
const promise = Promise.all([previous?.promise, ...defaults.map((write) => write.promise)].map((save) => save?.catch(() => {})))
.then(async () => {
- if (patch.resetApprovalToAsk && window.ogb?.approvals) {
- return window.ogb.approvals.setMode(botId, "ask", {
- threadId, modelSelection: patch.modelSelection, updateBotDefault: Boolean(patch.updateBotDefault),
- });
- }
+ const askBridge = patch.resetApprovalToAsk ? askResetBridge() : undefined;
+ if (askBridge) return askBridge.setMode(botId, "ask", {
+ threadId, modelSelection: patch.modelSelection, updateBotDefault: Boolean(patch.updateBotDefault),
+ });
return persistTaskApproval(botId, threadId, patch, desktopApprovalBridge());
});
const execution = Promise.all([previous?.execution, promise]);