diff --git a/apps/daemon/src/app-config.ts b/apps/daemon/src/app-config.ts index 0c2c8356dfc..53afb690fc3 100644 --- a/apps/daemon/src/app-config.ts +++ b/apps/daemon/src/app-config.ts @@ -200,6 +200,7 @@ const AGENT_CLI_ENV_KEYS: ReadonlyMap> = new Map([ 'OPENCODE_TEST_HOME', ])], ['aider', new Set(['AIDER_BIN'])], + ['antigravity', new Set(['AGY_BIN'])], ['claude', new Set(['CLAUDE_CONFIG_DIR', 'CLAUDE_BIN', 'ANTHROPIC_BASE_URL', 'ANTHROPIC_API_KEY', 'ANTHROPIC_AUTH_TOKEN', 'MMD_MODEL_ROUTES_FILE'])], ['codex', new Set(['CODEX_HOME', 'CODEX_BIN', 'OPENAI_BASE_URL', 'CODEX_API_KEY', 'OPENAI_API_KEY'])], ['copilot', new Set(['COPILOT_BIN'])], diff --git a/apps/daemon/src/runtimes/defs/antigravity.ts b/apps/daemon/src/runtimes/defs/antigravity.ts index 58e89cecd9b..f55a5291799 100644 --- a/apps/daemon/src/runtimes/defs/antigravity.ts +++ b/apps/daemon/src/runtimes/defs/antigravity.ts @@ -215,18 +215,6 @@ export const antigravityAgentDef = { runtimeContext.antigravitySettingsPath, ); } - // We invoke agy via `-p -` (print mode + stdin sentinel), NOT - // `chat -`. Verified against `agy --help` on v1.0.3 — the - // `Available subcommands` list is `changelog / help / install / - // plugin / update`, and `chat` is NOT among them. `-p` is the - // documented print-mode flag (`Short alias for --print`) and - // `agy -p -` reads the prompt from stdin. The looper reviewer - // bot's environment runs a different agy build that may have - // renamed the entry point; until upstream confirms a stable - // headless subcommand (see google-antigravity/antigravity-cli#119) - // and the change actually ships in the auto-update channel that - // packaged OD users get, `-p -` is the contract that actually - // produces a print-mode reply on the installed CLI. const args: string[] = []; // Always opt into `--log-file` when the daemon supplied a path so // it can post-exit grep for the actual upstream failure shape @@ -235,16 +223,9 @@ export const antigravityAgentDef = { // never echoes those errors on stdout. See server.ts empty-output // guard for the consumer. // - // Flag order is load-bearing on agy v1.0.3: `agy -p --log-file - // /tmp/x -` runs successfully but leaves /tmp/x empty, while `agy - // --log-file /tmp/x -p -` captures the diagnostic log, including - // `Propagating selected model override to backend: label=""` - // and auth/quota failures. if (runtimeContext.agentLogFilePath) { args.push('--log-file', runtimeContext.agentLogFilePath); } - args.push('-p'); - args.push('-'); return args; }, promptViaStdin: true, diff --git a/apps/daemon/src/runtimes/executables.ts b/apps/daemon/src/runtimes/executables.ts index a9b3c46adff..126aea02bd1 100644 --- a/apps/daemon/src/runtimes/executables.ts +++ b/apps/daemon/src/runtimes/executables.ts @@ -16,6 +16,7 @@ const RUNTIME_PROJECT_ROOT = path.resolve( const AGENT_BIN_ENV_KEYS = new Map([ ['amr', 'VELA_BIN'], ['aider', 'AIDER_BIN'], + ['antigravity', 'AGY_BIN'], ['claude', 'CLAUDE_BIN'], ['codebuddy', 'CODEBUDDY_BIN'], ['codex', 'CODEX_BIN'], diff --git a/apps/daemon/tests/runtimes/agent-args.test.ts b/apps/daemon/tests/runtimes/agent-args.test.ts index 7ea22fe079b..135ea84b5c7 100644 --- a/apps/daemon/tests/runtimes/agent-args.test.ts +++ b/apps/daemon/tests/runtimes/agent-args.test.ts @@ -534,18 +534,18 @@ test('qwen args check promptViaStdin, base args, model args and exclude `-` sent // the daemon would render the resulting empty reply as a "successful" // agent response — exactly the failure mode the auth/quota guard at // server.ts ~12090 is meant to catch but for the wrong reason. -test('antigravity pipes prompt via stdin via -p flag (print mode)', () => { +test('antigravity uses STDIN for the prompt instead of the legacy -p flag', () => { assert.equal(antigravity.bin, 'agy'); assert.equal(antigravity.streamFormat, 'plain'); assert.equal(antigravity.promptViaStdin, true); const args = antigravity.buildArgs('write hello world', [], [], {}, {}); - assert.deepEqual(args, ['-p', '-']); + assert.deepEqual(args, []); const argsWithLog = antigravity.buildArgs('write hello world', [], [], {}, { agentLogFilePath: '/tmp/od-agy-test.log', }); - assert.deepEqual(argsWithLog, ['--log-file', '/tmp/od-agy-test.log', '-p', '-']); + assert.deepEqual(argsWithLog, ['--log-file', '/tmp/od-agy-test.log']); // No `--model` flag exists upstream, so buildArgs argv must stay the // same regardless of which label the user picks. @@ -560,7 +560,7 @@ test('antigravity pipes prompt via stdin via -p flag (print mode)', () => { antigravitySettingsPath: join(settingsDir, 'settings.json'), }); assert.equal(withModel.includes('--model'), false); - assert.deepEqual(withModel, ['--log-file', '/tmp/od-agy-test.log', '-p', '-']); + assert.deepEqual(withModel, ['--log-file', '/tmp/od-agy-test.log']); } finally { rmSync(settingsDir, { recursive: true, force: true }); } @@ -576,13 +576,13 @@ test('antigravity pipes prompt via stdin via -p flag (print mode)', () => { const followUp = antigravity.buildArgs('next message', [], [], {}, { hasPriorAssistantTurn: true, }); - assert.deepEqual(followUp, ['-p', '-']); + assert.deepEqual(followUp, []); assert.equal(followUp.includes('-c'), false); const firstTurn = antigravity.buildArgs('first', [], [], {}, { hasPriorAssistantTurn: false, }); - assert.deepEqual(firstTurn, ['-p', '-']); + assert.deepEqual(firstTurn, []); assert.equal(antigravity.resumesSessionViaCli, undefined); assert.equal(antigravity.maxPromptArgBytes, undefined);