Skip to content

enhance(review): antigravity lane trims every plan into one run and can't tell when agy read only part of it; review one plan per run and check the read #5491

Open

Description

@arakasi1

Pre-submission checklist

  • I have confirmed this improves existing behavior — it does not add a new command, workflow, or concept
  • I have searched existing issues and this enhancement has not already been proposed
  • I have read CONTRIBUTING.md and understand I must wait for approved-enhancement before writing any code
  • I can clearly describe the concrete benefit — not just "it would be nicer"

What existing feature or behavior does this improve?

The antigravity review lane in /gsd-review (review-lane invoke --slug antigravity) on multi-plan phases. Follow-up to #5049 / #5468, which listed agy's own limits as out of scope.

Current behavior

#5468 fixed delivery: with review.max_prompt_tokens_per_reviewer.antigravity set, agy now gets the trimmed gsd-review-prompt-antigravity.md. Two problems remain for any phase whose plans don't fit the budget:

  1. The budget is met by cutting the plans. On our project the 45k-token budget truncated plans by 58–85% and usually omitted CONTEXT (from prompt-budget's own metadata, Phases 166–181). The lane then reviews a fraction of each plan. Across ten phases its reviews said "proceed"/LOW while Codex, on the full plans, found 2–4 HIGH defects each time, and agy's specifics were often invented (test files, schema names, requirement IDs).

  2. agy can't reliably read a large prompt, and nothing reports it. On agy 1.3.5:

    The lane returns rc=0 and a normal-looking review in every one of these cases.

Proposed behavior

When the antigravity prompt exceeds its budget, review one plan per agy run instead of trimming every plan into a single run, and verify each run read its plan:

  • Per plan, send a small prompt that points at that plan (plus the shared CONTEXT/REQUIREMENTS), tells agy to keep paging past the per-read cap, and requires a first line restating the plan's requirements, wave, depends_on and task count.
  • Fail or flag a run (for example [incomplete-read] in REVIEWS.md) when that line is missing or doesn't match the plan's frontmatter, or when the output contains <truncated.
  • Merge the per-plan outputs into the lane's single review section, as today.

If per-plan batching is too much for one change, the truncation and proof-of-reading check alone would at least stop a partial read from looking like a successful review.

Reason and benefit

We tested this by hand on a 4-plan phase (255 KB prompt, gemini-4-argon-high). With per-plan pointer prompts (about 2.4 KB each), 4/4 runs restated their plan correctly. They took 3–4.5 min each in parallel, about the same wall-clock as one trimmed run. The reviews were grounded, and one found a real defect Codex missed. The single-run review of the same phase had reviewed requirement IDs and config names that are not in the plans.

Scope of changes

gsd-core/workflows/review.md (the antigravity lane's prompt construction when over budget) and the lane result handling in src/review-lane-invocation.cts / review-lane-runner.cts (the per-plan fan-out and the read check). Other lanes are unchanged. Cursor and kimi-code use the same argv-file-ref channel and could opt in, but I haven't measured their read limits.

Breaking changes

None. Phases that fit the budget keep the current single-run behavior.

Alternatives considered

Area affected

Core workflow (init, plan, build, verify)

Additional context

Related: #5049 / #5468 (delivery fix), #4559 (default caps; trim vs refuse), google-antigravity/antigravity-cli#224, #878, #1245 (no setting raises the read cap or disables compaction). Tested with GSD 1.16.0, agy 1.3.5, Linux.

Activity

  1. arakasi1 commented on Oct 17, 2026

    @arakasi1
    ContributorAuthor

    Follow-up data after #5468, which delivers --prompt-file to argv-file-ref lanes. GSD was built from next @ 8fba509, with agy 1.4.1 and gemini-4-argon-high.

    Rerun of the original failing phase. Same plans and the same 255 KB prompt, trimmed to 162 KB by the 45k budget (plans cut 58%).

    • The fix works. agy opened gsd-review-prompt-antigravity.md and read all of it.
    • The trimmed plans weren't enough for it, so it opened all four full plans from the repo. It compacted right after, then compacted again later. The lane still returned rc=0 with a normal 21.6 KB review.
    • Much better grounded than before. There were no invented requirement IDs, and the line citations I spot-checked were exact.
    • Its top finding was still invented after compaction. It said a plan's Playwright route **/maps/*.config.json misses /maps/config.json. The plan actually routes **/maps/<map>.config.json and loads /?site=<map>, and agy also renamed the plan's fixture values. It missed the issues Codex found on the same plans.

    Where agy compacts. Each conversation's metadata records a fixed limit of 128,000 tokens (gen_metadata field 1.9.10.4 in ~/.gemini/antigravity-cli/conversations/<id>.db). The model window reports 1,048,576. The rerun first compacted at about 114K tokens used. I couldn't move the limit with any of these:

    • AGY_CLI_AUTO_COMPACT_OVERRIDE=400000
    • compactionThreshold or checkpointIntervalTokens in settings.json
    • eight values of the contextWindow setting
    • the argon-high, argon-low, flash-3.8 and pro-3.1 models

    The 1.4.x release notes add no control. The only option is manual /compact, which doesn't work in -p mode. google-antigravity/antigravity-cli#878, #1245 and #743 are open with no maintainer response.

    What this means for this proposal:

    1. A whole multi-plan phase can't fit in one agy run. The prompt plus every file agy opens has to stay under about 100K tokens, so one run per plan is the practical shape.
    2. Trimming plans backfires. agy works around missing plan text by re-reading the full files, and that pushes it over the limit. Each per-plan run should carry its plan in full.
    3. The read check still matters. A post-compaction review looks just as complete as a good one.
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

    needs-triageNew issue awaiting maintainer review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions