[PR #7837] feat: add usage tracking API and /usage dialog #12529

Open
opened 2026-02-16 18:17:26 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7837

State: open
Merged: No


What does this PR do?

Adds a usage tracking API + TUI dialog for authenticated providers, including Codex and Copilot (rewritten for native Copilot plugin).

  • Adds /usage server route plus shared Usage module for fetching, caching, and normalizing usage snapshots
  • Captures Codex rate-limit headers and 429s to update usage state
  • Adds /usage autocomplete handling and a unified usage dialog (plan/quota parsing, scaling, reset display)
  • Regenerates SDK/OpenAPI artifacts for the new endpoint

How did you verify your code works?

  • Manual testing: verified with Copilot OAuth on free tier; GPT account on Plus plan; further provider/plan tests needed
  • bun run typecheck (fails in packages/opencode/src/server/server.ts:202 due to existing deep type instantiation error; unchanged from upstream)

https://github.com/user-attachments/assets/c71668e0-f9aa-4acc-b732-f60a06dc76d0

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7837 **State:** open **Merged:** No --- ### What does this PR do? Adds a usage tracking API + TUI dialog for authenticated providers, including Codex and Copilot (rewritten for native Copilot plugin). - Adds `/usage` server route plus shared `Usage` module for fetching, caching, and normalizing usage snapshots - Captures Codex rate-limit headers and 429s to update usage state - Adds `/usage` autocomplete handling and a unified usage dialog (plan/quota parsing, scaling, reset display) - Regenerates SDK/OpenAPI artifacts for the new endpoint ### How did you verify your code works? - Manual testing: verified with Copilot OAuth on free tier; GPT account on Plus plan; further provider/plan tests needed - `bun run typecheck` (fails in `packages/opencode/src/server/server.ts:202` due to existing deep type instantiation error; unchanged from upstream) https://github.com/user-attachments/assets/c71668e0-f9aa-4acc-b732-f60a06dc76d0
yindo added the pull-request label 2026-02-16 18:17:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12529