fix(cli): accept agy alias for supervised worker starts

This commit is contained in:
Neil
2026-09-19 05:12:43 -07:00
parent 8bcb02cdde
commit dc2c76ff30
3 changed files with 41 additions and 1 deletions
@@ -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<string, string | boolean>([
['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' })
)
})
@@ -13,6 +13,7 @@ import { renderResolvedOrchestrationCommand } from '../../orchestration-mutation
export const ORCHESTRATION_WORKER_LAUNCH_HANDLER: Record<string, CommandHandler> = {
'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<string, CommandHandler>
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'),
@@ -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.',