fix: filter and order Antigravity per-model quota windows#1209
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 30, 2026, 4:07 PM ET / 20:07 UTC. Summary Reproducibility: yes. at source/proof level: current main maps every Antigravity model quota into Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest 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 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 AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3631312d4b62. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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
|
There was a problem hiding this comment.
💡 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".
| private static func parseVersion(from label: String) -> AntigravityModelVersion? { | ||
| guard let regex = try? NSRegularExpression(pattern: #"(\d+)(?:\.(\d+))?"#) else { return nil } |
There was a problem hiding this comment.
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 👍 / 👎.
c9105d5 to
8aae9a9
Compare
|
Addressed the [P2] raw-id version parsing finding in 464472c.
For context: in the live catalogs I captured, the actual Antigravity model ids already use dotted minors ( On the remote |
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.
464472c to
4853b73
Compare
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():fetchAvailableModels): the entire account catalog, including internal/legacy models; entries without adisplayNameshow their raw model id.PR #1139's mapping took all
modelQuotas, unfiltered, sorted alphabetically. The existingnormalizeModelclassification (isLite,isAutocomplete/tab_, family) was bypassed.Change
Make the projection source-aware:
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 antigravityagainst a real account (redacted), built from this branch.Remote (OAuth) — BEFORE (current
main): 13 entries, alphabetical, with noiseRemote (OAuth) — AFTER (this branch): 7 entries, junk removed, family-grouped
Local — AFTER (this branch): 8 curated models, family-grouped, unchanged set
Tests
Tests/CodexBarTests/AntigravityStatusProbeTests.swiftadds 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.swiftupdated for the source-aware path.Acceptance:
swift test --filter AntigravityStatusProbeTests,make build.🤖 Generated with Claude Code