Problem
The Gemini consultation lane delivers the wrong prompt to Antigravity CLI (agy) because Codev orders the --print argument incorrectly.
With agy 1.0.10, --print is a string-valued flag and requires its prompt immediately afterward. Codev currently builds:
agy --print --sandbox --print-timeout 5m --add-dir <workspace> --add-dir <temp> <actual-prompt>
As a result, agy consumes the next token, --sandbox, as the print prompt. The real consultation prompt is never delivered. The command can still exit 0 and emit non-empty, plausible-looking meta-output, so Codev records the lane as successful.
This is a concrete root cause for the off-task/no-verdict behavior tracked more broadly in #1032.
Environment reproduced
agy --version: 1.0.10
- globally installed
@cluesmith/codev: 3.1.9
- repository
main: 3.2.0
- Linux
Both the globally installed release and current main exhibit the bug.
Reproduction matrix
All three Codev front doors fail:
consult -m gemini --prompt 'Reply with exactly: CONSULT_GEMINI_OK'
consult -m pro --prompt 'Reply with exactly: PRO_ALIAS_OK'
consult -m gemini --prompt-file /tmp/prompt.txt
Observed responses include:
- generic guidance about using a sandbox;
- "It looks like you've sent me the
--sandbox flag";
- an explicit statement that only
--sandbox was received and no review prompt/diff was provided.
The commands exit 0 and Codev writes these responses as consultation output.
Direct control tests isolate the ordering problem:
# Broken: reproduces Codev ordering; agy responds to --sandbox rather than the prompt
agy --print --sandbox --print-timeout 45s 'Reply with exactly: AGY_OK'
# Working: prompt is the value of --print
agy --sandbox --print-timeout 45s --print 'Reply with exactly: AGY_OK'
# Also working
agy --print='Reply with exactly: AGY_OK' --sandbox --print-timeout 45s
The correctly ordered form also successfully used agentic file access to read packages/codev/package.json and return its exact 3.2.0 version.
Root cause
packages/codev/src/commands/consult/index.ts constructs:
const args = ['--print', '--sandbox', '--print-timeout', AGY_PRINT_TIMEOUT];
for (const d of addDirs) args.push('--add-dir', d);
args.push(promptArg);
For the current agy CLI contract, args[1] becomes the --print value. Therefore the model receives --sandbox, not promptArg.
The unit tests only assert that --print, --sandbox, and --add-dir are present. The prompt-folding test explicitly expects promptArg to be the final argv item, preserving the invalid ordering rather than validating the CLI contract.
Second affected call site: codev doctor
packages/codev/src/commands/doctor.ts has the same pattern:
spawn(bin, ['--print', '--print-timeout', '20s', 'Reply with just OK'], ...)
Here --print-timeout can be consumed as the prompt. Any non-empty generic response may make the probe falsely report agy as operational without testing the intended prompt or timeout behavior.
Expected fix
Construct the argv so the prompt is the actual value of --print, for example:
const args = ['--sandbox', '--print-timeout', AGY_PRINT_TIMEOUT];
for (const d of addDirs) args.push('--add-dir', d);
args.push('--print', promptArg);
Apply equivalent ordering to the doctor probe.
Acceptance criteria
Related
Problem
The Gemini consultation lane delivers the wrong prompt to Antigravity CLI (
agy) because Codev orders the--printargument incorrectly.With
agy1.0.10,--printis a string-valued flag and requires its prompt immediately afterward. Codev currently builds:As a result,
agyconsumes the next token,--sandbox, as the print prompt. The real consultation prompt is never delivered. The command can still exit 0 and emit non-empty, plausible-looking meta-output, so Codev records the lane as successful.This is a concrete root cause for the off-task/no-verdict behavior tracked more broadly in #1032.
Environment reproduced
agy --version:1.0.10@cluesmith/codev:3.1.9main:3.2.0Both the globally installed release and current
mainexhibit the bug.Reproduction matrix
All three Codev front doors fail:
Observed responses include:
--sandboxflag";--sandboxwas received and no review prompt/diff was provided.The commands exit 0 and Codev writes these responses as consultation output.
Direct control tests isolate the ordering problem:
The correctly ordered form also successfully used agentic file access to read
packages/codev/package.jsonand return its exact3.2.0version.Root cause
packages/codev/src/commands/consult/index.tsconstructs:For the current
agyCLI contract,args[1]becomes the--printvalue. Therefore the model receives--sandbox, notpromptArg.The unit tests only assert that
--print,--sandbox, and--add-dirare present. The prompt-folding test explicitly expectspromptArgto be the final argv item, preserving the invalid ordering rather than validating the CLI contract.Second affected call site:
codev doctorpackages/codev/src/commands/doctor.tshas the same pattern:Here
--print-timeoutcan be consumed as the prompt. Any non-empty generic response may make the probe falsely reportagyas operational without testing the intended prompt or timeout behavior.Expected fix
Construct the argv so the prompt is the actual value of
--print, for example:Apply equivalent ordering to the doctor probe.
Acceptance criteria
consult -m gemini --prompt 'Reply with exactly: OK'delivers the complete prompt and returnsOK, not sandbox meta-commentary.consult -m proand--prompt-fileuse the same corrected path.codev doctorpasses its intended probe text as the value of--printand retains the 20-second print timeout.--print(or is supplied as--print=<prompt>), not merely that both tokens occur somewhere in argv.agytest covers the current 1.0.10 argument contract.Related