Skip to content

feat(tui): add rate-limit reset redemption to /usage#28154

Open
jayp-oai wants to merge 1 commit into
codex/rate-limit-reset-app-serverfrom
codex/usage-rate-limit-resets
Open

feat(tui): add rate-limit reset redemption to /usage#28154
jayp-oai wants to merge 1 commit into
codex/rate-limit-reset-app-serverfrom
codex/usage-rate-limit-resets

Conversation

@jayp-oai

Copy link
Copy Markdown
Collaborator

Why

Codex users can earn personal rate-limit reset credits, but the CLI does not currently provide a way to view or redeem them. The /usage command restored in #27925 is intended to be the entry point for usage-related actions, so reset redemption belongs there rather than in a separate dashed slash command.

Depends on #28143 for the app-server and backend-client reset-credit APIs.

What changed

  • Turn bare /usage into a menu with entries for token activity and earned rate-limit resets while preserving /usage daily, /usage weekly, and /usage cumulative.
  • Add loading, empty, confirmation, success, retry, and error states with stable redemption request IDs for idempotent retries.
  • Show an availability hint only for backend-classified rate-limit errors with credits available.
  • Hide the reset entry for workspace accounts.

Validation

  • just test -p codex-tui chatwidget::tests::usage - 14 passed.
  • Focused idempotency retry test - passed cleanly on rerun.
  • just fix -p codex-tui - passed.
  • cargo insta pending-snapshots from codex-rs/tui - no pending snapshots.

Examples

image image image

@jayp-oai jayp-oai force-pushed the codex/usage-rate-limit-resets branch from df9d29d to 9e246b3 Compare June 14, 2026 04:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: df9d29d6db

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/chatwidget/usage.rs
Comment thread codex-rs/tui/src/chatwidget/usage.rs
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