Repository navigation
fix(usage): summarize the composer quota for the selected model - #7148
Merged
Merged
Conversation
The composer usage indicator summarized the hottest window across the
whole account. Antigravity reports separate quota groups ("Gemini
Models", "Claude and GPT models"), so with Gemini selected the
indicator showed the Claude/GPT weekly window instead of Gemini's.
Usage windows now carry the display names of the models that share
them, parsed from agy's group description; an empty list keeps the
account-wide meaning for every other provider. The composer prefers
windows that apply to the selected model's label (unscoped or listing
it) and falls back to all windows when none apply.
Matching on display names is deliberate: agy /usage only exposes names,
so resolving them to model IDs in the Host would still join on names
while adding catalog-readiness edge cases.
Generated-by: Claude Code (claude-opus-5-5)
…ants
`models` was skipped when empty but generated as required in the
agent.externalUsageLimits output schema, so any agy group without a
description made the Host reject the whole usage reading. Defaulting
the field makes the schema match what is serialized.
A model listed once by `agy models` keeps its effort suffix in the
picker label ("GPT-OSS 120B (Medium)") while `/usage` lists the bare
name, so the composer fell back to the account-wide window. Accept a
label that is a listed name followed by a parenthesized variant.
Generated-by: Claude Code (claude-opus-5-5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The composer usage indicator summarized the hottest window across the whole account. Antigravity reports separate quota groups ("Gemini Models" and "Claude and GPT models"), so with Gemini 4 Neon selected the composer showed
7d 90%from the Claude/GPT weekly window while the Gemini weekly window had 92% left.Usage windows now carry the display names of the models that share them.
agy /usagelists them in each group's description ("Models within this group: …"), so the Antigravity adapter parses that into a new optionalmodelsfield onUsageLimit::Window. An empty list keeps the existing account-wide meaning, so other providers are unchanged.The composer summary now picks the hottest window among those that apply to the selected model: unscoped windows plus windows that list the model's label. A label also matches a listed name followed by a parenthesized variant, because
agy modelskeeps the effort suffix on models it lists only once ("GPT-OSS 120B (Medium)") while/usagelists the bare name. When none apply (no model selected, or a model agy does not list), it falls back to all windows as before.Matching uses display names on purpose.
agy /usageonly exposes names, so resolving them to model IDs in the Host would still join on names while adding catalog-readiness edge cases.Verification
node --test products/maka/workbench/tests/composer-toolbar.test.mjs: pass. The new cases (selected-group match, lone-variant label match, unmatched fallback, account-wide window included) fail on the baseline summary; the lone-variant case also fails with the variant match removed.cargo nextest run -p maka-agent-native -p maka-providers -p maka-agent-ports -E 'test(usage)': 6 passed, including the updated agy usage parser test.cargo fmt --all -- --check,cargo clippy -p maka-agent-ports -p maka-providers -p maka-agent-native --all-targets --no-deps -- -D warnings, biome on changed TS files, andnode scripts/ci.mjs run contracts(regenerated SDK types): pass.modelsis optional in both output schemas (agent.externalUsageLimits,settings.connectionUsageLimits). Checked with Ajv against the generated contracts: a reading that mixes scoped windows and a window withoutmodels(agy group without a description) validates on both endpoints.7d 92%(Gemini weekly), Claude Opus 5.5 shows7d 90%(Claude and GPT weekly). The screenshots above come from the same root and window, built from the base commit and from this branch.AI use
Select exactly one:
Tool(s) and scope: Claude Code (claude-opus-5-5) diagnosed the issue, implemented the change and tests, and ran the verification above under my direction and review.
Checklist
Does this PR entail a change in behavior?