Skip to content

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

Merge #4395

milind-soni813e295cf1b8
diff --cc src/components/ModelPicker.tsx
index 13d2bc10b3,541b2157cd..b50a7864f9
--- a/src/components/ModelPicker.tsx
+++ b/src/components/ModelPicker.tsx
@@@ -3,10 -3,9 +3,9 @@@ import { createPortal } from "react-dom
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp, KeyRound, Loader2, RefreshCw, X } from "lucide-react";
import { useStore, currentTaskBot, type Bot, type InstanceInfo, type ModelSelection } from "@/state/store";
import type { EffortLevel } from "../../shared/wire";
- import type { ModelVariantOption } from "../../shared/runtime-events";
import { filterCustomModels, partitionCustomModels, suggestedModels } from "@/lib/custom-models";
-import { configuredModelInstances, isClaudeAccount, isCustomOnly, SIGN_IN_FAMILY_LABEL, signInFamily } from "@/lib/engine-rail";
-import { modelName, simpleModelMenu } from "@/lib/simple-model-menu";
+import { configuredModelInstances, isClaudeAccount, isCustomOnly, modelsAwaitEngine, SIGN_IN_FAMILY_LABEL, signInFamily } from "@/lib/engine-rail";
+import { modelName, simpleModelMenu, variantSuffix } from "@/lib/simple-model-menu";
import { choiceIsSelected, modelChoices, modelSelectionForPick, takesTypedModels, withTypedModels, type ModelChoice } from "@/lib/model-choices";
export { modelSelectionForPick } from "@/lib/model-choices";
import { pickerPlacement, type PickerPlacement } from "@/lib/picker-placement";
@@@ -447,7 -443,11 +444,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 ? `${botModelInstance.displayName} · ${modelLabel(botModelInstance, profile.modelSelection.model)}${variantSuffix(botModelInstance, profile.modelSelection.model, profile.modelSelection.variant)}` : profile.modelSelection.model;
+ const busyUpdatesBotDefault = Boolean(threadId) && (simpleView ? simpleUpdatesBotDefault : scope === "bot")
+ && bot.modelSelection.instanceId === profile.modelSelection.instanceId && bot.modelSelection.model === profile.modelSelection.model;
const ownModelThreads = threadsOnOwnModel(profile.modelSelection, profile.tasks ?? []).length;
const pickBotModel = () => {
@@@ -967,8 -968,7 +966,8 @@@
} : { width: popoverWidth }}
className={cn("menu-surface z-[80] flex flex-col overflow-hidden", motion.className)}
>
+ <UsageMenuRows engine={selection.instanceId} />
- {simpleMenu ? (
+ {bot.busy ? <BusyModelMenu bot={shown} threadId={threadId} updateBotDefault={busyUpdatesBotDefault} variants={Boolean(active?.capabilities?.modelVariants)} /> : simpleMenu ? (
<SimpleModelMenu
menu={simpleMenu}
query={query}