Skip to content

feat(opencode): show model provider quota in prompt metrics#24826

Closed
50sotero wants to merge 7 commits into
anomalyco:devfrom
50sotero:fix/codex-quota-prompt-metrics
Closed

feat(opencode): show model provider quota in prompt metrics#24826
50sotero wants to merge 7 commits into
anomalyco:devfrom
50sotero:fix/codex-quota-prompt-metrics

Conversation

@50sotero
Copy link
Copy Markdown

@50sotero 50sotero commented Apr 28, 2026

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a prompt-metrics surface for model/provider quota information. This PR wires up Codex quota first: it reads the existing OpenAI OAuth session, fetches a best-effort five-hour/weekly quota snapshot through a non-blocking experimental console endpoint, and renders it below the chat box in the existing prompt metrics row.

This keeps the global footer/status/version area unchanged. The Codex usage source is ChatGPT's private /backend-api/wham/usage endpoint, so the quota data is intentionally best-effort and isolated under the experimental console surface.

How did you verify your code works?

  • bun test test/plugin/codex.test.ts test/cli/tui/sync-provider.test.tsx test/cli/cmd/tui/prompt-metrics.test.ts
  • bun typecheck
  • OPENCODE_VERSION=1.14.28 bun run build --single --skip-install --skip-embed-web-ui
  • bun turbo typecheck
  • tmux visual smoke at 160x42 confirmed the quota row stays below the prompt and does not overwrite the footer/version line.

Screenshots / recordings

Temporarily removed while screenshots are sanitized.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Hey! Your PR title Show Codex quota in prompt metrics doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

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

Based on my searches, I found one PR that appears potentially related:

Related PR Found:

However, #16337 appears to be an older architectural change for providing footer space, while the current PR (#24826) specifically implements Codex quota display using that infrastructure.

Other tangentially related PRs:

None of these appear to be direct duplicates of PR #24826's specific implementation of showing Codex quota in prompt metrics.

@50sotero 50sotero changed the title Show Codex quota in prompt metrics feat(opencode): show Codex quota in prompt metrics Apr 28, 2026
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@50sotero 50sotero changed the title feat(opencode): show Codex quota in prompt metrics feat(opencode): show model provider quota in prompt metrics Apr 28, 2026
@50sotero
Copy link
Copy Markdown
Author

Closing this for now while I refine the quota meter presentation and screenshot evidence. I will submit a cleaner PR once that is sorted out.

@50sotero 50sotero closed this Apr 28, 2026
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