Skip to content

consult: harden agy integration — Gemini lane silently drops out (upstream agy non-TTY stdout bug #76) #1020

Open

Description

@amrmelsayed

Scope

This tracks codev's consult integration with the agy CLI. The empty-output root cause is an open upstream agy bug (google-antigravity/antigravity-cli#76); codev cannot fix that directly, but it can work around it and stop misreporting it.

Root cause (upstream, not codev)

google-antigravity/antigravity-cli#76 — agy --print / -p silently drops stdout when stdout is not a TTY (pipe, redirect, subprocess): exit 0, no stderr, a full model round-trip but zero output. consult spawns agy with piped stdout (spawn(bin, args, { stdio: ['ignore', 'pipe', 'pipe'] }), consult/index.ts:814), so it hits this on every run, and the empty output is then treated as a non-blocking skip.

  • Status: open (filed 2026-05-21), no maintainer fix.
  • Reproduced here on agy 1.0.6 / macOS (the issue was first filed against 1.0.0 / Windows), so it is cross-platform and persists across versions.
  • agy 1.0.6 has no --output / --format flag (only --log-file); issue Update projectlist: mark spec 0042 as committed #76 requests --output <path>, --format json, or unconditional stdout flush, none shipped yet.

Correction to the earlier hypothesis: --sandbox is not the cause. Every empty reproduction was piped / captured (non-TTY), which is #76, independent of --sandbox. (The separate browser/key popup some runs trigger is agy's re-auth flow, not the empty-output cause.)

Codev-ownable slice

  1. Misleading diagnosis. The skip message says "agy not authenticated / install the CLI" when the real cause is the non-TTY stdout drop and auth is fine. Fix agySkipContent to name the likely cause (and link Update projectlist: mark spec 0042 as committed #76).
  2. Silent degradation. A 3-way consult quietly becomes 2-way (Codex + Claude) with no loud signal (consult/index.ts:858-874). Surface the dropped lane so it is not mistaken for a full 3-way.
  3. Workaround (the only way to make the lane actually work before the upstream fix). Run agy under a pseudo-TTY so its stdout is a terminal (defeats the Update projectlist: mark spec 0042 as committed #76 drop), or adopt agy's --output / --format once upstream ships it. Track Update projectlist: mark spec 0042 as committed #76 as the dependency.

Evidence

Upstream (not codev)

The real fix is google-antigravity/antigravity-cli#76. Not codev's to fix; codev tracks it and works around it. Related: google-antigravity/antigravity-cli#115, google-gemini/gemini-cli#27466.

References

Activity

  1. added
    area/consult
    on Jun 9, 2026
  2. changed the title [-]consult: Gemini lane (agy) silently skips — `agy --print --sandbox` produces no output[/-] [+]consult: harden the agy integration — Gemini lane silently and misleadingly drops out[/+] on Jun 9, 2026
  3. changed the title [-]consult: harden the agy integration — Gemini lane silently and misleadingly drops out[/-] [+]consult: harden agy integration — Gemini lane silently drops out (upstream agy non-TTY stdout bug #76)[/+] on Jun 9, 2026
  4. amrmelsayed commented on Jun 9, 2026

    @amrmelsayed
    CollaboratorAuthor

    Fix options: PTY workaround vs wait-for-upstream (tradeoff)

    The empty output is the upstream non-TTY stdout drop (google-antigravity/antigravity-cli#76). codev can work around it now or wait for an upstream flag. Options, in order of cost:

    1. Diagnostics + loud degradation — do this regardless, cheap.
    Fix agySkipContent so the skip names the real cause (non-TTY stdout drop; link #76) instead of "not authenticated", and make the 3-way → 2-way drop visible so a 2-way consult is not mistaken for a 3-way. Independent of any agy change; pure win.

    2. PTY workaround — medium effort, brittle, opt-in.
    Spawn agy attached to a pseudo-TTY so isatty(stdout) is true and it flushes output; read the PTY master. codev already depends on node-pty (Tower's terminal backend), so the dependency and expertise exist. Catch: the PTY yields the raw terminal stream — ANSI escapes, cursor moves, and agy's incremental "drip" TUI redraw — with no clean delimiters around the response, so consult must strip ANSI and reconstruct the final text from a redrawing stream. That parsing is version-sensitive (agy can change its TUI rendering at any time). Worth it only if a real 3-way Gemini verdict justifies the fragility.

    3. Upstream flag — cleanest, zero codev maintenance.
    When agy ships --output <path> / --format json / unconditional stdout flush (all requested in #76), adopt it and delete any workaround. agy 1.0.6 has none of these yet (only --log-file, a diagnostic log, not the response).

    Long shot to rule out first: check whether --log-file happens to capture the model response (probably not — it is a diagnostic log).

    Recommendation: ship option 1 now; treat option 2 as opt-in (only if a 3-way Gemini verdict is needed); prefer option 3 when it lands. The Gemini lane is non-blocking, so none of this gates consults — they run 2-way (Codex + Claude) meanwhile.

  5. amrmelsayed commented on Jun 10, 2026

    @amrmelsayed
    CollaboratorAuthor

    Update 2026-06-10: agy upgraded to 1.0.7 and the silent-drop symptom this issue describes appears to be resolved upstream.

    Verified on this machine:

    • agy --version → 1.0.7 (was 1.0.6 when the symptom was observed)
    • printf "say ok\n" | agy --print --sandbox → returns ok cleanly in ~8s (was hanging silently with 0 bytes output)
    • Cold-start latency consistent enough that subsequent consult invocations stay well within AGY_TIMEOUT_MS

    Caveat: codev doctor still reports ✗ Gemini (agy) timeout even with 1.0.7 working. That's a tighter verify-step budget inside doctor than the consult lane itself uses — not an agy issue. The actual builder consults should run the gemini lane successfully under 1.0.7.

    Net: the upstream agy fix in 1.0.7 likely closes the main symptom this issue tracks. Worth leaving open one cycle to confirm across multiple builder consult runs that the silent-drop doesn't recur, then either close as fixed-upstream OR narrow scope to "tune the doctor's verify-step timeout so its report matches the consult lane's reality."

  6. amrmelsayed commented on Jun 10, 2026

    @amrmelsayed
    CollaboratorAuthor

    Additional symptom variant (from #789 PR-review consult — agy 1.0.6, macOS, builder worktree)

    Instead of the documented zero-output drop, the Gemini lane returned a non-empty but contextless response (~123 bytes), reproduced on a retry:

    "The current workspace is empty. Please let me know what we are building, modifying, or debugging, and we can get started!"

    agy ran (~18s, no auth/timeout marker) and flushed stdout, but emitted a generic "no task" greeting rather than a review — it never picked up the diff/prompt context.

    Gap this exposes in the codev-ownable slice (item 2, silent degradation): the close handler only treats empty output as a skip (raw.length === 0 → skip; consult/index.ts:858-874). A non-empty greeting passes the raw.length > 0 check and is recorded as a successful review (writeConsultOutput(raw)) even though it has no VERDICT: line and no review content — so the dropped lane isn't surfaced as a skip; downstream has to notice the missing verdict and hand-treat it.

    Suggestion: also detect non-review output — e.g. treat output with no VERDICT: token (or matching agy's known "workspace is empty"/"what are we building" greeting) as a dropped lane, not a verdict — so a 3-way that silently became 2-way is surfaced consistently whether agy emits zero bytes or a greeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/consult

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions