Skip to content

Conversation

@IgorWarzocha
Copy link

@IgorWarzocha IgorWarzocha commented Jan 11, 2026

What does this PR do?

Adds a usage tracking API + TUI dialog for authenticated providers, including Codex and Copilot (using current OAuth implementation as of 1.1.13).

  • 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)
screenrecording-2026-01-11_18-37-51.mp4

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search results, I found 2 highly related PRs that appear to address similar or overlapping functionality:

Potential Duplicates:

  1. PR feat: display Anthropic and OpenAI OAuth usage in status dialog and sidebar #6905: feat: display Anthropic and OpenAI OAuth usage in status dialog and sidebar

    • Related because it also implements usage tracking and display for authenticated providers (Anthropic and OpenAI) in a dialog/sidebar context
  2. PR feat: Add (z.ai) plan usage tracking in the sidebar #6298: feat: Add (z.ai) plan usage tracking in the sidebar

    • Related because it implements usage/plan tracking display functionality for another provider

These PRs implement similar functionality (usage display for providers), though PR #7837 appears to be a more comprehensive solution with a dedicated /usage API endpoint and unified dialog supporting multiple providers (Codex and Copilot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant