Skip to content

fix: filter and order Antigravity per-model quota windows#1209

Merged
steipete merged 5 commits into
steipete:mainfrom
guhyun9454:fix/antigravity-model-window-filtering
May 30, 2026
Merged

fix: filter and order Antigravity per-model quota windows#1209
steipete merged 5 commits into
steipete:mainfrom
guhyun9454:fix/antigravity-model-window-filtering

Conversation

@guhyun9454
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1139. That PR exposed every Antigravity model quota in extraRateWindows. On the remote OAuth fallback path this dumps the full account catalog — 13+ entries including internal models (tab_flash_lite_vertex, tab_jump_flash_lite_vertex), image models, and lite variants — alphabetically sorted. The menu expanded to 15+ rows of noise (reported in #1139).

Root cause

Both data sources flow through AntigravityStatusSnapshot.toUsageSnapshot():

  • Local probe (running Antigravity IDE language server): a small curated list.
  • Remote OAuth fallback (fetchAvailableModels): the entire account catalog, including internal/legacy models; entries without a displayName show their raw model id.

PR #1139's mapping took all modelQuotas, unfiltered, sorted alphabetically. The existing normalizeModel classification (isLite, isAutocomplete/tab_, family) was bypassed.

Change

Make the projection source-aware:

  • Local (curated, trusted): show all models, ordering only.
  • Remote (noisy fallback): show a model only if it is family-recognized and not lite/autocomplete/image, or its quota was actually consumed (remainingFraction < 0.999).

Replace the alphabetical sort with a stable family-grouped order parsed from the label (family rank → version desc → tier → label) — new model versions slot in automatically, no hardcoded model list. The three summary slots (Claude / Gemini Pro / Gemini Flash) are unchanged.

Real behavior proof

Verified with codexbar usage --provider antigravity against a real account (redacted), built from this branch.

Remote (OAuth) — BEFORE (current main): 13 entries, alphabetical, with noise

Gemini 2.5 Flash Image, tab_flash_lite_vertex, Gemini 2.5 Pro, Gemini 3 Pro (High),
Gemini 2.5 Flash Lite, Gemini 3 Pro Image, Gemini 3 Flash, Gemini 3.1 Flash Lite,
Gemini 3.1 Pro (Low), Gemini 3.1 Pro (High), tab_jump_flash_lite_vertex,
Gemini 3 Pro (Low), Gemini 2.5 Flash

Remote (OAuth) — AFTER (this branch): 7 entries, junk removed, family-grouped

Gemini 3.1 Pro (High), Gemini 3.1 Pro (Low), Gemini 3 Pro (High), Gemini 3 Pro (Low),
Gemini 2.5 Pro, Gemini 3 Flash, Gemini 2.5 Flash

Local — AFTER (this branch): 8 curated models, family-grouped, unchanged set

Claude Opus 4.6 (Thinking), Claude Sonnet 4.6 (Thinking),
Gemini 3.1 Pro (High), Gemini 3.1 Pro (Low),
Gemini 3.5 Flash (High), Gemini 3.5 Flash (Medium), Gemini 3.5 Flash (Low),
GPT-OSS 120B (Medium)

Tests

Tests/CodexBarTests/AntigravityStatusProbeTests.swift adds local (show-all) and remote (filtered) fixtures built from the exact verified catalogs above, plus conditional-display (consumed junk shown) and ordering edge cases. MenuCardAntigravityTests.swift updated for the source-aware path.

Acceptance: swift test --filter AntigravityStatusProbeTests, make build.

🤖 Generated with Claude Code

@clawsweeper
Copy link
Copy Markdown

clawsweeper Bot commented May 29, 2026

Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 4:07 PM ET / 20:07 UTC.

Summary
The PR makes Antigravity quota projection source-aware, filters noisy unconsumed remote model windows, keeps local model windows complete, orders model windows by family/version/tier, and expands focused Antigravity/menu tests.

Reproducibility: yes. at source/proof level: current main maps every Antigravity model quota into extraRateWindows, and the PR body provides redacted live codexbar usage --provider antigravity before/after output. I did not run a live account probe because AGENTS.md forbids unrequested real-account validation that may touch credentials.

Review metrics: 1 noteworthy metric.

  • Remote extra windows: 13 before, 7 after. This is the compatibility-relevant behavior change for remote OAuth fallback users and API consumers.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Confirm that maintainers accept the remote extraRateWindows contraction as the new default contract.
  • [P2] Let the current-head checks finish or add explicit make check evidence before merge.

Mantis proof suggestion
A short visual check would materially confirm the menu row count/order that the CLI proof implies. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify Antigravity remote OAuth fallback menu shows seven family-grouped per-model rows and hides unconsumed tab/lite/image rows.

Risk before merge

  • [P1] Remote OAuth CLI/serve/menu consumers that depended on the full extraRateWindows catalog will see fewer unconsumed lite, image, autocomplete, internal, or unknown rows after upgrade if maintainers accept this as the new contract.
  • [P1] Full make check evidence was not present in the PR body, and the current-head GitHub checks were still in progress when reviewed; I did not run checks because this is a read-only review.

Maintainer options:

  1. Accept the filtered remote projection
    Maintainers can explicitly accept that remote OAuth extraRateWindows is now a cleaner visible/default projection rather than a loss-free catalog.
  2. Preserve a full-catalog escape hatch
    Before merge, keep a separate full remote catalog/debug/API path and apply this filter only to the user-visible/default projection.

Next step before merge

  • [P2] Human review should confirm the intended remote output contract and wait for current-head validation rather than queueing an automated repair.

Security
Cleared: No concrete security or supply-chain regression was found; the diff changes Antigravity quota projection/tests and does not broaden credential access, dependencies, or code execution paths.

Review details

Best possible solution:

Land the source-aware filtering and ordering if maintainers accept the remote catalog contraction; otherwise preserve a separate full-catalog/debug surface while keeping the visible menu projection quiet.

Do we have a high-confidence way to reproduce the issue?

Yes, at source/proof level: current main maps every Antigravity model quota into extraRateWindows, and the PR body provides redacted live codexbar usage --provider antigravity before/after output. I did not run a live account probe because AGENTS.md forbids unrequested real-account validation that may touch credentials.

Is this the best way to solve the issue?

Yes if maintainers accept the output contract change: the source-aware projection is narrow, tested, and now includes maintainer-authored refinements for remote summaries. If extraRateWindows must stay loss-free for remote consumers, the better solution is a separate full-catalog path plus filtered visible output.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 3631312d4b62.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted real codexbar usage --provider antigravity before/after output from the branch, which is sufficient live-output proof for this CLI-visible behavior.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority Antigravity provider output fix with a limited but real compatibility surface.
  • merge-risk: 🚨 compatibility: The PR intentionally changes the already-exposed remote extraRateWindows output shape from a full catalog to a filtered projection.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted real codexbar usage --provider antigravity before/after output from the branch, which is sufficient live-output proof for this CLI-visible behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted real codexbar usage --provider antigravity before/after output from the branch, which is sufficient live-output proof for this CLI-visible behavior.
Evidence reviewed

What I checked:

Likely related people:

  • guhyun9454: Authored the merged Antigravity per-model quota window work that first exposed this extraRateWindows surface, and authored the first three commits on this follow-up branch. (role: introduced related behavior; confidence: high; commits: 352f0b19cfb5, f53b1bce277b, 65b57eb6b983; files: Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift, Tests/CodexBarTests/AntigravityStatusProbeTests.swift, Tests/CodexBarTests/MenuCardAntigravityTests.swift)
  • steipete: Recently touched Antigravity local/remote quota handling on main and pushed the latest branch commits that refine the remote fallback behavior. (role: recent area contributor and branch committer; confidence: high; commits: 2e4cb422bf0a, a541828ac0f1, 9e815217d310; files: Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift, Tests/CodexBarTests/AntigravityStatusProbeTests.swift)
  • 陳柏瑋: Introduced the OAuth-backed Antigravity remote usage path that this PR now marks as .remote and filters. (role: remote fallback feature introducer; confidence: medium; commits: e98c8f5e4c0d; files: Sources/CodexBarCore/Providers/Antigravity/AntigravityRemoteUsageFetcher.swift, Sources/CodexBarCore/Providers/Antigravity/AntigravityStatusProbe.swift, Tests/CodexBarTests/AntigravityRemoteUsageFetcherTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad2b5ebfd5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +234 to +235
private static func parseVersion(from label: String) -> AntigravityModelVersion? {
guard let regex = try? NSRegularExpression(pattern: #"(\d+)(?:\.(\d+))?"#) else { return nil }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Parse hyphenated model-id versions before sorting

When the remote catalog omits displayName, parseModelQuotas falls back to using the raw model id as the label, e.g. gemini-3-1-pro-low. This regex only recognizes dotted versions, so that label is parsed as version 3.0 instead of 3.1; in the new family/version/tier sort, gemini-3-pro-high can then be ordered ahead of gemini-3-1-pro-low because tier is compared before the label tiebreaker. That regresses the intended newest-version-first ordering specifically for remote entries without display names.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
@guhyun9454 guhyun9454 force-pushed the fix/antigravity-model-window-filtering branch from c9105d5 to 8aae9a9 Compare May 29, 2026 07:08
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels May 29, 2026
@guhyun9454
Copy link
Copy Markdown
Contributor Author

Addressed the [P2] raw-id version parsing finding in 464472c.

parseVersion now accepts - as well as . between major and minor, so a raw model id used as the label when displayName/label is absent (e.g. gemini-3-1-pro-low) parses as 3.1 and keeps newest-first ordering. Added a regression test (hyphenated raw model ids without display name parse minor version).

For context: in the live catalogs I captured, the actual Antigravity model ids already use dotted minors (gemini-3.1-pro-low, gemini-2.5-pro) and every family-recognized model carries a displayName, while the only raw-id-as-label entries (tab_*_vertex) are filtered out — so this didn't misorder observed data. The fix is defensive against the hyphenated-id shape and verified to leave dotted-version parsing unchanged.

On the remote extraRateWindows shape change (13 → 7): that's the intended behavior of this PR and is a maintainer call — happy to gate it behind an option or keep a separate full-catalog projection if preferred over changing the existing output.

guhyun9454 and others added 5 commits May 30, 2026 20:55
PR steipete#1139 exposed every Antigravity model quota in extraRateWindows,
which on the remote OAuth fallback path dumps the full account catalog
(13+ entries incl. internal models like tab_*_vertex, image, and lite
variants), alphabetically sorted. The menu expanded to 15+ rows of noise.

Make the projection source-aware in AntigravityStatusSnapshot.toUsageSnapshot():
- Local probe (curated IDE list): show all models, sorted only.
- Remote OAuth fallback (noisy catalog): hide tab_/autocomplete/lite/image/
  unknown-family models unless their quota was actually consumed
  (remainingFraction < 0.999).

Replace the alphabetical sort with a stable family-grouped order parsed
from the label (family rank -> version desc -> tier -> label), so the list
groups sensibly and new model versions slot in automatically without a
hardcoded model list. The three summary slots (Claude/Gemini Pro/Gemini
Flash) are unchanged.

Verified against a real account: local 8 models render grouped; remote
13 -> 7 with junk removed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fixes CI lint failure (conditionalAssignment, redundantReturn, wrap, indent).
When a remote quota omits displayName/label, the raw model id is used as
the label. Accept '-' as well as '.' between major and minor so an id like
gemini-3-1-pro-low parses as 3.1 and keeps newest-first ordering. Adds a
regression test. Current Antigravity ids use dotted minors and legit models
carry displayNames, so this is defensive; no change for observed data.
@steipete steipete force-pushed the fix/antigravity-model-window-filtering branch from 464472c to 4853b73 Compare May 30, 2026 20:04
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels May 30, 2026
@steipete steipete merged commit 5dec44e into steipete:main May 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants