Skip to content

feat(chat): remaining quota on the current conversation header - #481

Open
Adam-Dalloul wants to merge 8 commits into
xintaofei:mainfrom
Adam-Dalloul:feat/chat-header-remaining-quota
Open

feat(chat): remaining quota on the current conversation header#481
Adam-Dalloul wants to merge 8 commits into
xintaofei:mainfrom
Adam-Dalloul:feat/chat-header-remaining-quota

Conversation

@Adam-Dalloul

@Adam-Dalloul Adam-Dalloul commented Aug 16, 2026

Copy link
Copy Markdown

Merge order

  1. #472 first (Token Usage remaining-quota card)
  2. Then this PR (#481)

This branch already contains #472. Merge #472 first so this reviews as the header-chip delta.


Remaining plan quota currently lives only on the Token Usage workbench. That is a click away from the chat you are in.

This puts a quiet gauge chip on the current conversation header (same row as the ⋯ menu). It shows that agent's family remaining (Claude / Codex / Grok official numbers, extra slots included). Click opens a small popover with the same 5-hour / weekly windows and bars. Other agents have no remaining-quota source, so the chip stays hidden.

Same official payloads as #472. No invented numbers. No secrets.

Token Usage now lists isolatable families. Remaining plan quota is
emitted only from a recorded official remaining-subscription envelope.
ACP usage_update stays context occupancy. Families without a payload
link to the provider usage page instead of inventing a number.
Codex remaining comes from documented app-server account/rateLimits/read.
Claude remaining comes from the /usage HUD five_hour utilization payload.
Other families still link to the provider page instead of inventing a number.
subscription-quota now calls official `codex app-server --stdio`
`account/rateLimits/read` and parses the live envelope (primary
usedPercent, window, reset, extra limit ids).

Local CLI check: Claude `auth status` and `claude -p /usage` do not
publish remaining plan quota. Grok has no usage command. OpenCode
`stats` is historical cost, not remaining. Those rows stay links.
There is no `claude usage` CLI. Live `GET /api/oauth/usage` with the local
Claude Code OAuth token returns five_hour / seven_day utilization as 0-100
percents. That is the HUD payload community monitors already parse.

The panel fetches it next to Codex. Utilization is not treated as a 0-1
fraction. Weekly and extra-usage windows show as extras. Tokens are never
logged.
Live `GET /v1/billing?format=credits` on cli-chat-proxy.grok.com with the
Grok CLI OAuth token returns config.creditUsagePercent. The panel fetches
that next to Codex and Claude. Tokens and emails are never logged.

Gemini and OpenCode still have no remaining-quota command.
@Adam-Dalloul
Adam-Dalloul force-pushed the feat/chat-header-remaining-quota branch from ad5109c to 37805a4 Compare August 16, 2026 17:00
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.

1 participant