fix(cli): show Codex OAuth quota in status bar - #66198
Closed
baileyh8 wants to merge 3 commits into
Closed
Conversation
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds an opt-in OpenAI Codex OAuth quota readout to the classic CLI status bar. It shows only the windows returned by the usage API, as remaining percentages:
The usage request runs in a daemon worker and never blocks prompt-toolkit rendering. Results are cached for five minutes, refresh failures fail open and hide stale values, and the cache is isolated by a non-reversible credential identity plus generation guard so an old account request cannot overwrite a newly rotated credential.
The fix also recognizes the current API shape where a single seven-day window is returned as
primary_window; that window is labeled Weekly rather than Session.Related Issue
No existing issue found.
Type of Change
Changes Made
primary_window.5h N%and/orweek N%; omit unavailable windows.display.account_usage_footer.enabledandrefresh_secondsdefaults and examples.How to Test
Authenticate with
hermes authusing OpenAI Codex OAuth.Add this to
~/.hermes/config.yaml:Start classic CLI with an OpenAI Codex model. The status bar should show
week N%; when the API also returns the five-hour window it should show5h N% | week N%.Run:
Verification on macOS 26.5.1:
week 69%,5h None; renderedweek 69%only.Checklist
Code
Documentation & Housekeeping
cli-config.yaml.exampleScreenshots / Logs