diff --git a/src/cli/handlers/orchestration-worker-agent-alias.test.ts b/src/cli/handlers/orchestration-worker-agent-alias.test.ts new file mode 100644 index 00000000000..0846cf648a0 --- /dev/null +++ b/src/cli/handlers/orchestration-worker-agent-alias.test.ts @@ -0,0 +1,38 @@ +import { afterEach, expect, it, vi } from 'vitest' +import { RuntimeClient } from '../runtime-client' +import { ORCHESTRATION_WORKER_LAUNCH_HANDLER } from './orchestration/worker-launch-handler' + +vi.mock('../format', () => ({ printResult: vi.fn() })) + +afterEach(() => vi.restoreAllMocks()) + +it.each([undefined, 'remote-host'])('sends the canonical Antigravity agent to %s', async (on) => { + const client = new RuntimeClient('test-profile', 60_000, null, null) + const call = vi.spyOn(client, 'call').mockResolvedValue({ + id: 'request_1', + ok: true, + _meta: { runtimeId: 'runtime_1' }, + result: { state: 'ready' } + }) + const flags = new Map([ + ['agent', 'agy'], + ['task', 'task_1'], + ['worktree', 'id:folder:workspace_1'], + ['from', 'term_coord'] + ]) + if (on) { + flags.set('on', on) + } + + await ORCHESTRATION_WORKER_LAUNCH_HANDLER['orchestration worker-start']({ + flags, + client, + cwd: '.', + json: true + }) + + expect(call).toHaveBeenCalledWith( + 'orchestration.workerStart', + expect.objectContaining({ agent: 'antigravity', on, worktree: 'id:folder:workspace_1' }) + ) +}) diff --git a/src/cli/handlers/orchestration/worker-launch-handler.ts b/src/cli/handlers/orchestration/worker-launch-handler.ts index b6e4d92799c..b6dddd67e35 100644 --- a/src/cli/handlers/orchestration/worker-launch-handler.ts +++ b/src/cli/handlers/orchestration/worker-launch-handler.ts @@ -13,6 +13,7 @@ import { renderResolvedOrchestrationCommand } from '../../orchestration-mutation export const ORCHESTRATION_WORKER_LAUNCH_HANDLER: Record = { 'orchestration worker-start': async ({ flags, client, cwd, json }) => { + const agent = getOptionalStringFlag(flags, 'agent') const model = getOptionalStringFlag(flags, 'model') const effort = getOptionalStringFlag(flags, 'effort') if (model || effort) { @@ -59,7 +60,7 @@ export const ORCHESTRATION_WORKER_LAUNCH_HANDLER: Record displayName: getOptionalStringFlag(flags, 'display-name'), comment: getOptionalStringFlag(flags, 'comment'), setup: getOptionalStringFlag(flags, 'setup'), - agent: getOptionalStringFlag(flags, 'agent'), + agent: agent === 'agy' ? 'antigravity' : agent, model, effort, terminal: getOptionalStringFlag(flags, 'terminal'), diff --git a/src/cli/specs/orchestration-worker-specs.ts b/src/cli/specs/orchestration-worker-specs.ts index 1608a586a15..e60f7a32140 100644 --- a/src/cli/specs/orchestration-worker-specs.ts +++ b/src/cli/specs/orchestration-worker-specs.ts @@ -32,6 +32,7 @@ export const ORCHESTRATION_WORKER_COMMAND_SPECS: CommandSpec[] = [ 'retry-request' ], notes: [ + '--agent agy is an alias for antigravity; both use the configured Antigravity launcher.', 'Current and existing worktrees never rerun setup; a fresh agent terminal is created unless --terminal is explicit.', 'When reusing --terminal, pass --worktree for that terminal; current means the coordinator worktree.', '--model supports Claude, Codex, and Cursor opaque provider model ids; --effort requires --model. Neither can combine with --terminal.',