Skip to content

fix(antigravity): show a saved level model as its family and level in the chat composer - #48017

Merged
nwparker merged 1 commit into
stablyai:mainfrom
zjffdu:fix-antigravity-effort-label
Nov 24, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
zjffdu:fix-antigravity-effort-label

Conversation

@zjffdu

@zjffdu zjffdu commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

An Antigravity chat saved with the model gemini-4-neon-high showed Gemini 4 Neon High High in the composer: once in the model name and again as the effort. Now it shows Gemini 4 Neon with High effort, and the effort picker lists that model's levels.

What Changed

  • Before: agy lists each level as its own id (gemini-4-neon-high, -medium, -low), and Orca's listing groups them into one gemini-4-neon row with efforts. A chat saved with the level id did not match any grouped row, so the composer kept the saved id as its own row, labeled it "Gemini 4 Neon High", and put the High effort next to it.
  • After: the composer shows the gemini-4-neon row with high selected, and the next message sends that family and level.
  • Mechanism: StructuredAgentDefinition.restingOptions gets an optional listedSelection hook that maps saved options onto the chat's current listing. ACP dialects can provide it, and Antigravity's dialect provides antigravityListedFamilySelection (moved from antigravity-model-listing.ts into the dialect). It maps a level id to its family row and level only when the listing offers that family with that level (and the requested effort) and does not list the id itself. Both the resting options read and the live options read apply it. The stored session record stays unchanged, so nothing is rewritten on disk.

Why

The bug comes from the saved selection not matching the listing, so the fix maps the selection where options are read instead of patching the label. That keeps the shown row, the effort control and the sent selection consistent. Agents without the hook behave exactly as before. A model the listing doesn't group (an unknown level id, or one agy lists as its own row) keeps its own row.

This is a partial fix for the issue. It covers the composer display and selection for saved level ids. Orchestration-worker creation already normalizes the suffix (#46941).

Linked Issue

Fixes #47987
Refs #46913

Original fix by @zjffdu in #48017; final version reworked during the bug bash.

Reported by @jianfengzhang-maersk

Visual Proof

N/A for this reworked version: the owner's Mac is in active use, so no Electron run was done. The composer result goes through the real options read and the real option snapshot in structured-agent-session-options-read.test.ts. The original before/after screenshots from #48017's description show the bug and the expected label:

Before (Orca 1.4.272) Expected
Composer shows Gemini 4 Neon High High Composer shows Gemini 4 Neon High

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns (the "keeps a model the listing does not group" case is a guard and passes either way)

  • Repro: an agy 1.5.15 listing (gemini-4-neon-high/medium/low, gpt-oss-120b-medium) with a chat saved as { model: 'gemini-4-neon-high' }, read through the real resting and live options readers with the real Antigravity definition.

  • structured-agent-session-options-read.test.ts: the composer shows gemini-4-neon / high with choices low, medium, high and sends { model: 'gemini-4-neon', effort: 'high' }. An explicit saved effort wins. Ungrouped ids keep their own row. A live chat answers the family row and level as saved, and the stored record stays unchanged. With the read changes reverted, both mapping tests fail.

  • antigravity-dialect.test.ts and the neighboring antigravity, resting-options and orchestration-worker suites: 14 files, 100 tests pass.

  • oxlint, oxfmt, the anti-slop and native-plugin oxlint configs, ast-grep, and the changed-code quality gate are clean on the touched files.

  • Platforms: unit tests on macOS. The change is pure TypeScript logic with no OS-specific paths.

Performance

None. This adds one regex and a linear scan of the already-loaded model listing, and only when options are read, not per keystroke or per frame. Measured: 0.36 µs per call with a typical listing, 21 µs with 2,000 family rows and a miss, 14 µs with a 10,000-char saved id. There is no new I/O, subprocess or polling.

Risk

Level: Low

Only agents that define listedSelection (only Antigravity today) change. If the mapping misfired, an Antigravity chat would show and send the family row plus level instead of the saved level id. That is the same pair the chat sends when a user picks that row and level in the composer. Saved records are not rewritten, and older paired clients and remote hosts get the same option payload shape. Back out with a plain revert.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

A structured-agent callback now maps eligible saved Antigravity model IDs to a listed family and effort. Option derivation applies the callback to saved options and available model entries. Tests cover displayed and outgoing selections, ungrouped models, and retention of the saved model ID in a live chat.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 16bac

This fixes the duplicated effort label in the Antigravity model picker by mapping saved suffixed model IDs to the listed family and effort. The saved model ID is kept for sending, and explicitly listed variants are unchanged. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Directly linked issue #47987 has one coding requirement. When the session lists the Gemini 4 Neon family and its efforts, the composer must show the family name and High once, not 'High High'. The cur…
Out of Scope Changes check Passed The current whole-PR summary lists changes that support the #47987 objective. The changes are: the listedSelection type and property (structured-agent-definition.ts, acp-dialect.ts); the family-…
Title check Passed The title names the main change: a saved Antigravity level model is now shown as its family and level in the chat composer. The changeset adds a listedSelection hook and an Antigravity mapping helper …
Description check Passed The description follows the template and fills in most required sections. It has an ELI5, a before/after account, the mechanism, a Why section, a linked issue (Fixes #47987), Visual Proof (N/A with a …
Full details: Linked Issues check

Explanation

Directly linked issue #47987 has one coding requirement. When the session lists the Gemini 4 Neon family and its efforts, the composer must show the family name and High once, not 'High High'. The current raw summary shows this path. antigravityListedFamilySelection in src/main/acp/acp-dialects/antigravity-dialect.ts maps a saved family-level ID such as gemini-4-neon-high to the listed family row and effort. It applies only when the listed family offers both the variant level and the resolved effort, and the requested ID is not listed directly. The dialect registers it as listedSelection. acp-structured-agent-definitions.ts passes it into restingOptions. readStructuredAgentSessionOptionsAtRest applies it to the stored conversation options. The new tests in structured-agent-session-options-read.test.ts assert that a saved level ID is presented as family plus effort, that ungrouped models stay separate, and that a live chat keeps the saved level ID in its options. The PR description reports a macOS run on agy 1.5.15 that showed gemini-4-neon-medium after an effort change. Limits: the changed blobs could not be read (the diff call for antigravity-dialect.ts returned unavailable), so the verdict relies on the whole-PR summary, the new tests as summarized, and the PR description. The composer view code was not in the summary, so the rendered label is supported by the tests and the reported run, not by a direct read. The previous assessment cited files under src/shared/agent-session/options/. A repository diff of that path against the merge base returned no changes. Those earlier conclusions are superseded by the current summary. Residual gap: when the catalog cannot confirm the family, the saved variant is kept. The issue scopes the expected behavior to sessions that list the family, so this case is outside the requirement.

Full details: Out of Scope Changes check

Explanation

The current whole-PR summary lists changes that support the #47987 objective. The changes are: the listedSelection type and property (structured-agent-definition.ts, acp-dialect.ts); the family-selection helper and its registration (antigravity-dialect.ts); the definition wiring (acp-structured-agent-definitions.ts); the read-path and resting-options changes (structured-agent-session-options-read.ts, structured-agent-session-resting-options.ts); the test fixture change (structured-agent-session-option-refresh.test-fixture.ts) and the new tests; and the helper move with its import update (antigravity-model-listing.ts, orchestration-structured-worker-session.ts, antigravity-dialect.test.ts). The helper removal and move are refactoring that serves the fix. No unrelated behavior change appears in the summary. The PR description's skill-installer and release-process checklist items are non-coding and match no changed file in the summary. The previous out-of-scope evidence cited files that the repository diff shows as unchanged, so it was not relied on.

Full details: Title check

Explanation

The title names the main change: a saved Antigravity level model is now shown as its family and level in the chat composer. The changeset adds a listedSelection hook and an Antigravity mapping helper that does this. The title uses the conventional fix(scope) form and stays within one line.

Full details: Description check

Explanation

The description follows the template and fills in most required sections. It has an ELI5, a before/after account, the mechanism, a Why section, a linked issue (Fixes #47987), Visual Proof (N/A with a reason and reference screenshots), Testing with concrete repro steps and platform, a Performance line, and a Risk section with level and back-out plan. The AI Disclosure section is left blank, which is allowed for internal contributors, and the Level and Review sections are filled in. Two gaps remain: the 'Review' heading has no content, and the lint, typecheck, test and build checklist item is unchecked, so the author has not confirmed it passed locally.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe0fdf4c-edff-4573-a02a-ec46e1981961
Commits

Reviewing files that changed from the base of the PR and between 4287239 and 16bac3e.

Files selected for processing: 11

  • src/main/acp/acp-dialects/acp-dialect.ts
  • src/main/acp/acp-dialects/antigravity-dialect.test.ts
  • src/main/acp/acp-dialects/antigravity-dialect.ts
  • src/main/acp/session/acp-structured-agent-definitions.ts
  • src/main/antigravity/antigravity-model-listing.ts
  • src/main/native-chat/agent-session-wire/host/testing/structured-agent-session-option-refresh.test-fixture.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-options-read.test.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-options-read.ts
  • src/main/native-chat/agent-session-wire/options/structured-agent-session-resting-options.ts
  • src/main/native-chat/agent-session-wire/providers/structured-agent-definition.ts
  • src/main/runtime/rpc/methods/orchestration/structured-workers/orchestration-structured-worker-session.ts
Files with no reviewable changes: 1

  • src/main/antigravity/antigravity-model-listing.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

… the chat composer

A chat saved with an Antigravity level id such as `gemini-4-neon-high`
showed "Gemini 4 Neon High High" because the saved id was kept as its own
row next to the High effort. Agent definitions can now map saved options
onto the chat's listing (`listedSelection`); Antigravity's dialect maps a
level id to its listed family row and level when the listing offers both
and does not list the id itself. The resting and live options reads apply
it, and the stored record is left unchanged.

Refs stablyai#47987

Co-authored-by: Jeff Zhang <[email protected]>
@nwparker
nwparker force-pushed the fix-antigravity-effort-label branch from 4287239 to 16bac3e Compare November 24, 2026 04:16
@nwparker nwparker changed the title Fix duplicate Antigravity effort in the chat composer fix(antigravity): show a saved level model as its family and level in the chat composer Nov 24, 2026
@nwparker
nwparker merged commit 08cc083 into stablyai:main Nov 24, 2026
57 of 59 checks passed
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.

[Bug]: Antigravity Native Chat shows Gemini 4 Neon High High in the composer

2 participants