Repository navigation
Description
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.txtObserved responses include:
- generic guidance about using a sandbox;
- "It looks like you've sent me the
--sandboxflag"; - an explicit statement that only
--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:
# 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 45sThe 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
-
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. - Structured Gemini reviews receive the complete role + query and can return a parseable verdict.
- Large-prompt temp-file indirection remains functional.
-
codev doctorpasses its intended probe text as the value of--printand retains the 20-second print timeout. - Unit tests assert the prompt immediately follows
--print(or is supplied as--print=<prompt>), not merely that both tokens occur somewhere in argv. - A guarded real-
agytest covers the current 1.0.10 argument contract.
Related
- agy/Gemini consult lane goes off-task on structured reviews — emits no VERDICT, breaking the porch consult loop #1032 — off-task structured reviews / missing verdicts (this issue identifies a concrete cause)
- Consult: Gemini (agy/Antigravity) reviewer runs in empty sandbox + can execute real commands in the worktree (ran porch done, wrote files) #1051 — empty-context and reviewer-safety failures
- porch: a consult that RAN but returned no VERDICT is treated as REQUEST_CHANGES (should be a non-blocking skip) — causes review-loop churn #1033 — no-verdict results causing Porch review-loop churn
- consult: harden agy integration — Gemini lane silently drops out (upstream agy non-TTY stdout bug #76) #1020 — separate historical non-TTY stdout problem
- agy --print / -p silently drops stdout when run with a non-TTY (pipe, subprocess, redirect) google-antigravity/antigravity-cli#76 — upstream non-TTY stdout tracking
Activity
mohidmakhdoomi commentedon Jun 19, 2026
On it! Working on a fix now.
[Bugfix cluesmith#1079] Fix: pass prompts as agy --print values
[Bugfix cluesmith#1079] Test: enforce agy print prompt adjacency
[Bugfix cluesmith#1079] docs: record PR review status
[Bugfix cluesmith#1079] docs: record authorized CMAP exception
Merge pull request #1081 from mohidmakhdoomi/builder/bugfix-1079
release notes: #1079 agy --print prompt-delivery root-cause fix (PR #…
Merge docs/vscode-changelog for v3.2.1 Karnak release