Skip to content

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

Open
jayp-oai wants to merge 2 commits 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 2 commits into
codex/rate-limit-reset-app-serverfrom
codex/usage-rate-limit-resets

Conversation

@jayp-oai

@jayp-oai jayp-oai commented Jun 14, 2026

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 — 19 passed.
  • just fix -p codex-tui — passed.
  • just fmt — passed.
  • cargo insta pending-snapshots from codex-rs/tui — no pending snapshots.

Examples

image image image

@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 Outdated
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