Skip to content

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

Show the picked Antigravity thinking level in the Simple model picker (#4160)

AdityaUmale144806786e57
diff --git a/src/components/ModelPicker.simple.test.ts b/src/components/ModelPicker.simple.test.ts
index 8e9847e9c7..cd91db8734 100644
--- a/src/components/ModelPicker.simple.test.ts
+++ b/src/components/ModelPicker.simple.test.ts
@@ -534,6 +534,17 @@ describe("the model picker in Simple mode", () => {
}));
});
+ it("shows the picked Antigravity thinking level on the closed picker, so the pick visibly lands (#4160)", () => {
+ const variants = [{ id: "low", label: "Low" }, { id: "medium", label: "Medium" }];
+ fixture.instances = [{ ...engine("antigravity", "antigravityAgent", "Google Gemini", "subscription", [
+ { id: "gemini-3.8-flash", label: "Gemini 3.8 Flash", variants },
+ ]), capabilities: { modelVariants: true } }];
+ const forBot = { ...bot(undefined, "antigravity", "gemini-3.8-flash"), modelSelection: {
+ instanceId: "antigravity", model: "gemini-3.8-flash", variant: "medium",
+ } };
+ expect(render(forBot, { contained: true }).html).toContain(">Gemini 3.8 Flash · Medium</span>");
+ });
+
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) => {
diff --git a/src/components/ModelPicker.tsx b/src/components/ModelPicker.tsx
index b856bce361..9baa1df059 100644
--- a/src/components/ModelPicker.tsx
+++ b/src/components/ModelPicker.tsx
@@ -672,7 +672,7 @@ export function ModelPicker({
: <span className="size-3.5 rounded-full bg-ink/[0.08]" aria-hidden="true" />}
{attention && <span data-model-attention className="absolute -bottom-0.5 -right-0.5 size-1.5 rounded-full bg-warning ring-[1.5px] ring-app" />}
</span>
- <span className="min-w-0 max-w-[160px] truncate">{modelName(active, selection.model)}</span>
+ <span className="min-w-0 max-w-[160px] truncate">{modelName(active, selection.model, selection.variant)}</span>
<UsageBars engine={selection.instanceId} className="ml-1.5" />
<ChevronDown size={12} strokeWidth={2} aria-hidden="true" className="ml-1 shrink-0 text-ink-tertiary group-hover:text-ink-secondary" />
</button>
@@ -974,7 +974,7 @@ export function ModelPicker({
menu={simpleMenu}
query={query}
bot={profile}
- botModel={{ label: modelName(botModelInstance, profile.modelSelection.model), title: botModelName }}
+ botModel={{ label: modelName(botModelInstance, profile.modelSelection.model, profile.modelSelection.variant), title: botModelName }}
thinking={thinking}
idPrefix={menuId}
onQuery={setQuery}
diff --git a/src/lib/simple-model-menu.test.ts b/src/lib/simple-model-menu.test.ts
index 1465a94faa..721be281c1 100644
--- a/src/lib/simple-model-menu.test.ts
+++ b/src/lib/simple-model-menu.test.ts
@@ -183,6 +183,19 @@ describe("the Simple model menu", () => {
expect(modelName(cursor, "gone-model")).toBe("gone-model");
});
+ it("names the picked Antigravity thinking level on the current model, as its row in the list does (#4160)", () => {
+ const variants = [{ id: "low", label: "Low" }, { id: "medium", label: "Medium" }];
+ const gemini = engine("antigravity", "antigravityAgent", "Google Gemini", "subscription", [
+ { id: "gemini-3.8-flash", label: "Gemini 3.8 Flash", variants },
+ ], { capabilities: { modelVariants: true } });
+ const picked = menu([gemini], { selection: { instanceId: "antigravity", model: "gemini-3.8-flash", variant: "medium" } });
+ expect(picked.current).toMatchObject({ label: "Gemini 3.8 Flash · Medium" });
+ expect(rows(picked)).toEqual(["Gemini 3.8 Flash · Low"]);
+ expect(modelName(gemini, "gemini-3.8-flash")).toBe("Gemini 3.8 Flash");
+ expect(modelName(gemini, "gemini-3.8-flash", "gone")).toBe("Gemini 3.8 Flash");
+ expect(modelName({ ...gemini, driverKind: "opencodeGo" }, "gemini-3.8-flash", "medium")).toBe("Gemini 3.8 Flash");
+ });
+
it("is busy while the menu reads its providers or one provider's models", () => {
expect(menu([claude()]).busy).toBe(false);
expect(menu([claude()], { loading: true }).busy).toBe(true);
diff --git a/src/lib/simple-model-menu.ts b/src/lib/simple-model-menu.ts
index 666395e991..dfb2b76f91 100644
--- a/src/lib/simple-model-menu.ts
+++ b/src/lib/simple-model-menu.ts
@@ -86,10 +86,12 @@ export function providerName(instance: InstanceInfo): string {
return instance.displayName.replace(/\s*\((?:API key|API)\)$/i, "") || instance.displayName;
}
-export function modelName(instance: InstanceInfo | undefined, model: string): string {
+/** With a variant, names the same choice its menu row does (Antigravity's thinking level), so a pick shows. */
+export function modelName(instance: InstanceInfo | undefined, model: string, variant?: string): string {
const option = instance?.models.options.find((candidate) => candidate.id === model);
if (!instance || !option) return model;
- return displayModelLabel(option.label, providerName(instance), option.custom);
+ const choice = modelChoices(instance, [option]).find((candidate) => choiceIsSelected(candidate, { instanceId: instance.instanceId, model, variant }));
+ return displayModelLabel((choice ?? option).label, providerName(instance), option.custom);
}
export function repeatedModelLabels(options: readonly ModelOption[]): Set<string> {
@@ -126,7 +128,7 @@ function currentRow(input: SimpleMenuInput): MenuCurrent {
const active = instances.find((instance) => instance.instanceId === selection.instanceId);
const option = active?.models.options.find((candidate) => candidate.id === selection.model);
const name = option?.label ?? selection.model;
- const row = { instance: active, label: modelName(active, selection.model), title: active ? `${active.displayName} · ${name}` : name, warning: false, pending: false };
+ const row = { instance: active, label: modelName(active, selection.model, selection.variant), title: active ? `${active.displayName} · ${name}` : name, warning: false, pending: false };
if (!active) return loading ? { ...row, pending: true } : { ...row, meta: t("model.simple.unavailable"), warning: true };
if (!option && input.refreshing === active.instanceId) return { ...row, pending: true };
if (option?.orgBlocked) return { ...row, meta: t("model.orgBlocked"), warning: true, blocked: true };