Skip to content

an open-source alternative to the dots, bots and muses of the world, run an office of claude code/codex like agents on your laptop, sandboxes or anywhere, uses your existing subscriptions

fix(antigravity): use agy's real model labels + quote-aware command parsing

Gulum1f182bb1c222
diff --git a/src/renderer/src/components/AddAgentModal.tsx b/src/renderer/src/components/AddAgentModal.tsx
index e9765b25..04ac6eeb 100644
--- a/src/renderer/src/components/AddAgentModal.tsx
+++ b/src/renderer/src/components/AddAgentModal.tsx
@@ -10,6 +10,7 @@ import {
type HarnessConfig,
type AgentProvider,
buildSpawnCommand,
+ tokenizeCommand,
modelsForProvider,
inferAgentProvider,
providerPreset,
@@ -87,8 +88,9 @@ export function AddAgentModal({ onClose, config }: AddAgentModalProps) {
const id = uniqueId(name);
const ptyId = `pty-${id}`;
// The command field contains `claude --permission-mode bypassPermissions`
- // for auto mode. Split into argv-style for node-pty.
- const [exe, ...args] = command.trim().split(/\s+/);
+ // for auto mode. Split into argv-style for node-pty (quote-aware so an agy
+ // model label like "Gemini 3.1 Pro (High)" stays one argument).
+ const [exe, ...args] = tokenizeCommand(command.trim());
const spawnRes = await window.cth.spawnPty({
id: ptyId,
cwd,
diff --git a/src/renderer/src/components/AgentStrip.tsx b/src/renderer/src/components/AgentStrip.tsx
index ad27f787..ad272479 100644
--- a/src/renderer/src/components/AgentStrip.tsx
+++ b/src/renderer/src/components/AgentStrip.tsx
@@ -3,7 +3,7 @@ import { AgentCard } from './AgentCard';
import { PixelButton } from './PixelButton';
import { Icon } from './Icon';
import { useStore, type Agent } from '@/store/store';
-import { buildSpawnCommand, type HarnessConfig } from '@/store/config';
+import { buildSpawnCommand, tokenizeCommand, type HarnessConfig } from '@/store/config';
export interface AgentStripProps {
/** Needed to rebuild a spawn command when a restorable agent predates the
@@ -30,7 +30,7 @@ export function AgentStrip({ config }: AgentStripProps) {
for (const a of [...restorableAgents]) {
const command = (a.command ?? '').trim() || (config ? buildSpawnCommand(config, a.model) : '');
if (!command || !a.cwd) { useStore.getState().removeRestorableAgent(a.id); continue; }
- const [exe, ...args] = command.split(/\s+/);
+ const [exe, ...args] = tokenizeCommand(command);
const ptyId = a.ptyId ?? `pty-${a.id}`;
const res = await window.cth.spawnPty({
id: ptyId,
diff --git a/src/renderer/src/components/CommandCenterPanel.tsx b/src/renderer/src/components/CommandCenterPanel.tsx
index 3ec14933..222ba817 100644
--- a/src/renderer/src/components/CommandCenterPanel.tsx
+++ b/src/renderer/src/components/CommandCenterPanel.tsx
@@ -13,7 +13,7 @@ import { useFleetTelemetry } from '@/hooks/useTelemetry';
import { COMMAND_GROUPS } from '@shared/claudeCommands';
import { useStore, type Agent } from '@/store/store';
import { usePtyParser } from '@/hooks/usePtyParser';
-import { buildSpawnCommand, AGENT_MODELS, modelsForProvider, inferAgentProvider, isClaudeProvider } from '@/store/config';
+import { buildSpawnCommand, AGENT_MODELS, modelsForProvider, tokenizeCommand, inferAgentProvider, isClaudeProvider } from '@/store/config';
/** Michael's control surface. Shown instead of the plain terminal/files panel
* when the god agent is selected: terminal + queue, the floor roster (with
@@ -301,7 +301,7 @@ function FloorTab({ seed }: { seed: { text: string; seq: number } }) {
// command if not explicitly tagged) so an Antigravity worker stays `agy`.
const provider = inferAgentProvider(a.command, a.provider);
const command = buildSpawnCommand(cfg, model, provider);
- const [exe, ...args] = command.trim().split(/\s+/);
+ const [exe, ...args] = tokenizeCommand(command.trim());
const hive = a.isGod
? { id: a.id, name: a.name, cwd: a.cwd, provider, isGod: true, role: 'orchestrator (god)' }
: a.isAssistant
diff --git a/src/renderer/src/store/config.ts b/src/renderer/src/store/config.ts
index 5ac2a5d1..4bf9f81a 100644
--- a/src/renderer/src/store/config.ts
+++ b/src/renderer/src/store/config.ts
@@ -91,17 +91,35 @@ export const AGENT_MODELS: ModelOption[] = [
{ id: 'claude-haiku-4-5-20251001', label: 'Haiku 4.5' }
];
-/** Gemini models offered when an agent runs on the Antigravity CLI (`agy`).
- * `--model` is free-form, so these are presets — the command field stays
- * editable. Run `agy models` (once logged in) for the live list. */
+/** Models offered when an agent runs on the Antigravity CLI (`agy`). agy's
+ * `--model` takes the DISPLAY-NAME LABEL exactly as `agy models` prints it
+ * (verified: agy logs `Propagating selected model override … label="…"`), not a
+ * slug — so these ids ARE the labels (spaces/parens included; buildSpawnCommand
+ * quotes them and the command tokenizer keeps them whole). The command field
+ * stays editable; `agy models` is the source of truth for the live list. */
export const ANTIGRAVITY_MODELS: ModelOption[] = [
{ id: undefined, label: 'default' },
- { id: 'gemini-3-pro', label: 'Gemini 3 Pro' },
- { id: 'gemini-3-flash', label: 'Gemini 3 Flash' },
- { id: 'gemini-2.5-pro', label: 'Gemini 2.5 Pro' },
- { id: 'gemini-2.5-flash', label: 'Gemini 2.5 Flash' }
+ { id: 'Gemini 3.1 Pro (High)', label: 'Gemini 3.1 Pro · High' },
+ { id: 'Gemini 3.1 Pro (Low)', label: 'Gemini 3.1 Pro · Low' },
+ { id: 'Gemini 3.5 Flash (High)', label: 'Gemini 3.5 Flash · High' },
+ { id: 'Gemini 3.5 Flash (Medium)', label: 'Gemini 3.5 Flash · Med' },
+ { id: 'Gemini 3.5 Flash (Low)', label: 'Gemini 3.5 Flash · Low' },
+ { id: 'Claude Sonnet 4.6 (Thinking)', label: 'Claude Sonnet 4.6' },
+ { id: 'Claude Opus 4.6 (Thinking)', label: 'Claude Opus 4.6' },
+ { id: 'GPT-OSS 120B (Medium)', label: 'GPT-OSS 120B' }
];
+/** Split a command string into argv, respecting double/single quotes so a model
+ * value with spaces (agy's `--model "Gemini 3.1 Pro (High)"`) stays one token.
+ * Quotes are stripped from the result. */
+export function tokenizeCommand(command: string): string[] {
+ const out: string[] = [];
+ const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
+ let m: RegExpExecArray | null;
+ while ((m = re.exec(command)) !== null) out.push(m[1] ?? m[2] ?? m[3]);
+ return out;
+}
+
/** The model preset list for a given provider's picker. */
export function modelsForProvider(provider: AgentProvider): ModelOption[] {
return provider === 'antigravity' ? ANTIGRAVITY_MODELS : AGENT_MODELS;
@@ -124,7 +142,12 @@ export function buildSpawnCommand(
? config.defaultCommand || ''
: preset.defaultCommand;
let cmd = base;
- if (preset.supportsModel && model && preset.modelFlag) cmd = `${cmd} ${preset.modelFlag} ${model}`;
+ if (preset.supportsModel && model && preset.modelFlag) {
+ // Quote model values that contain whitespace (agy labels like
+ // "Gemini 3.1 Pro (High)") so the command tokenizer keeps them one arg.
+ const m = /\s/.test(model) ? `"${model}"` : model;
+ cmd = `${cmd} ${preset.modelFlag} ${m}`;
+ }
if (config.autoMode && preset.autoFlag) cmd = `${cmd} ${preset.autoFlag}`;
return cmd;
}