Skip to content

fix(antigravity): parse two-column agy models output - #31

Open
andromarces wants to merge 4 commits into
rjx18:mainfrom
andromarces:fix/issue-28-antigravity-two-column-models
Open

andromarces wants to merge 4 commits into
rjx18:mainfrom
andromarces:fix/issue-28-antigravity-two-column-models

Conversation

@andromarces

Copy link
Copy Markdown
Contributor

Fixes #28

Problem

Antigravity CLI 1.2.2 prints agy models as two tab-separated columns per
line: a model slug, then a display name.

gemini-3.8-flash-medium	Gemini 3.8 Flash (Medium)

The adapter treated each whole line as a display name. The picker id became the
slug joined with the display (gemini-3.8-flash-medium-gemini-3.8-flash-medium),
and --model received the raw tab-joined line. agy rejected every discovered
model as not recognized.

Intended result

The picker lists one valid model per row, and the selected value reaches agy
as an argument it accepts.

Change

  • listModels splits each line on the first tab. The first column is the model
    id passed to --model; the second is the display name.
  • The two-column id is agy's own slug, used verbatim.
  • A single-column listing (older builds) keeps the existing antigravitySlug
    derivation and the reverse mapping back to the listed value.
  • Collision protection remains unchanged for single-column catalogs and now also
    applies to two-column model ids.
  • The fake agy output in the spec changes to the two-column format; the spec
    asserts the exact --model slug and covers collision rejection for both
    catalog shapes.

Compatibility decisions

  • Two-column slugs are trusted verbatim; observed agy slugs are [a-z0-9.-].
  • The single-column path is deliberately unchanged, so persisted model ids from
    older builds keep working.
  • ModelCatalog carries no display names, so the second column is used only to
    distinguish two entries that share an id.

Harn

This edits prose inside the harn:assume adapters-own-their-model-catalog block
in packages/adapters/antigravity/NOTES.md. Intended behavior change: the
adapter treats the first agy models column as the model id passed to --model,
retains the single-column fallback, and still fails discovery on id collisions.
.harn/assumptions/ and Harn hashes are untouched.

Tests

pnpm install --frozen-lockfile                     # passed
pnpm -r build                                      # passed
pnpm --filter @codor/adapter-antigravity test      # 12 passed
pnpm -r --no-bail test                             # exit 1

pnpm -r --no-bail test fails in 7 package scripts and passes in 13; Antigravity
passes 12/12. The failures are pre-existing relative to this diff. Unmodified
origin/main (03481a3) reproduced the same seven failed package scripts and the
same broad failure classes. The diff touches only
packages/adapters/antigravity. By class:

  • @codor/adapter-copilot, @codor/adapter-gemini, @codor/adapter-grok,
    @codor/adapter-opencode, @codor/switchboard: macOS /var vs /private/var
    cwd canonicalization and the discovery assertions that depend on it, with
    intermittent timeout cases.
  • @codor/cli: PTY-driven specs, Windows setup specs running on macOS, setup and
    pairing timeouts, and one worktree path assertion.
  • @codor/web-next: browser-storage setup failures (localStorage undefined),
    plus timeout and state-assertion cases.

Per-package counts differed across parallel full-suite executions, so this report
states failure classes rather than unstable counts.

Live verification on macOS with agy 1.2.2:

  • listModels() returned discovered, 14 models, gemini-3.8-flash-high first.
  • agy --mode plan --model gemini-3.8-flash-medium --print "Reply with the single word ok."
    returned ok, exit 0.

Not tested

  • Windows: no agy install available; the parser is platform-independent but
    was not exercised there.
  • Only agy 1.2.2 was run live. The single-column older-build path is covered by
    a fixture, not a real binary.

agy models prints a model slug and a display name in two tab-separated
columns. The adapter treated each whole line as the display name, so the
picker id became the slug joined with the display and --model received
the raw line. Antigravity rejected every discovered model.

Parse the first column as the model id and pass it to --model. Keep the
single-column path for older builds, including the display-name reverse
mapping. Update the fixture to the two-column format and assert the exact
--model slug.

Verified live with agy 1.2.2: listModels() returns the slug column, and
agy --model gemini-3.8-flash-medium --print exits 0.
…n coverage

Address review feedback on the two-column parser:

- derive the --model argument only for single-column rows, so the
  two-column path no longer stores identity entries; rename the field to
  modelArgs to match what it holds
- restore the single-column slug-collision test
- add the required one-line justification to each generated test
…tifications

Address review feedback:

- move the single- and two-column collision cases into one test so each
  test name matches what it asserts
- reduce each generated-test justification to one line
AGENTS.md requires a one-line justification that names both the
requirement and the reason the test is not redundant. Add the missing
non-redundancy clause to each generated test.
Copilot AI lite review requested due to automatic review settings September 12, 2026 09:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues remain, and the requested behavior is covered by implementation, tests, and documentation.

Pull request overview

Updates the Antigravity adapter to parse two-column agy models output while preserving single-column compatibility.

Changes:

  • Uses two-column slugs directly as model IDs.
  • Preserves legacy parsing and collision protection.
  • Expands tests for both catalog formats.
  • Documents the updated behavior.
File summaries
File Summary
packages/adapters/antigravity/src/adapter.ts Implements catalog parsing and model argument mapping.
packages/adapters/antigravity/src/adapter.spec.ts Tests both formats, argument forwarding, and collisions.
packages/adapters/antigravity/NOTES.md Documents current and legacy catalog behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

antigravity: agy models two-column output breaks model discovery and --model

2 participants