Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/daemon/src/app-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ const AGENT_CLI_ENV_KEYS: ReadonlyMap<string, ReadonlySet<string>> = 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'])],
Expand Down
19 changes: 0 additions & 19 deletions apps/daemon/src/runtimes/defs/antigravity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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="<model>"`
// and auth/quota failures.
if (runtimeContext.agentLogFilePath) {
args.push('--log-file', runtimeContext.agentLogFilePath);
}
args.push('-p');
args.push('-');
return args;
},
promptViaStdin: true,
Expand Down
1 change: 1 addition & 0 deletions apps/daemon/src/runtimes/executables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const RUNTIME_PROJECT_ROOT = path.resolve(
const AGENT_BIN_ENV_KEYS = new Map<string, string>([
['amr', 'VELA_BIN'],
['aider', 'AIDER_BIN'],
['antigravity', 'AGY_BIN'],
['claude', 'CLAUDE_BIN'],
['codebuddy', 'CODEBUDDY_BIN'],
['codex', 'CODEX_BIN'],
Expand Down
12 changes: 6 additions & 6 deletions apps/daemon/tests/runtimes/agent-args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 });
}
Expand All @@ -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);
Expand Down
Loading