Skip to content

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

Merge pull request #3569 from zicochaos/fix/model-picker-guest-scope

milind-sonid28a0688567f
diff --cc src/components/ModelPicker.tsx
index 0db8983bf7,85148a529b..75d2587582
--- a/src/components/ModelPicker.tsx
+++ b/src/components/ModelPicker.tsx
@@@ -439,9 -455,9 +439,9 @@@ export function ModelPicker(
const profile = state.bots.find((candidate) => candidate.id === bot.id) ?? bot;
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
- ? `${botModelInstance.displayName} · ${modelLabel(botModelInstance, profile.modelSelection.model)}`
- : profile.modelSelection.model;
+ 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) && (simpleView ? simpleUpdatesBotDefault : scope === "bot")
++ 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 = () => {
@@@ -466,8 -482,8 +466,8 @@@
if (bot.busy || instance.policy) return;
const nextSelection = modelSelectionForPick(selection, instance, model);
if (variant !== undefined) nextSelection.variant = variant;
- const updateBotDefault = !threadId || (simpleView ? simpleUpdatesBotDefault : scope === "bot");
- const updateBotDefault = !threadId || (mayChangeBotDefault && (simpleView || scope === "bot"));
- const targets = updateBotDefault ? [currentTaskBot(profile, threadId ?? bot.threadId), profile] : [bot];
++ const updateBotDefault = !threadId || (simpleUpdatesBotDefault && (simpleView || scope === "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))) {
@@@ -701,7 -709,7 +701,7 @@@
onAddApiKeys={remote ? undefined : openApiKeys} />}
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto">
- {threadId && (
- {threadId && mayChangeBotDefault && (
++ {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 gap-1">
{(["thread", "bot"] as const).map((value) => (
@@@ -886,7 -898,7 +886,7 @@@
compact
bot={shown}
threadId={threadId}
- updateBotDefault={Boolean(threadId && scope === "bot")}
- updateBotDefault={Boolean(threadId && mayChangeBotDefault && scope === "bot")}
++ 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>}
/>