feat: add Codex account usage summary to /usage#11177
Closed
abhi152003 wants to merge 1 commit into
Closed
Conversation
Contributor
|
Superseded by PR #13428 — #13428 (merged). #13428 lands the more complete three-provider implementation (OpenAI Codex + Anthropic OAuth + OpenRouter) that was originally submitted in PR #2486. Your Codex-only summary covered the same ground for one provider, but we went with the broader module since it also handles Anthropic OAuth and OpenRouter credits/key quotas. Thanks for the contribution! |
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.
Summary
hermes_cli/codex_usage.pymodule that fetches live quota usagefrom the OpenAI Codex API (
chatgpt.com/backend-api/wham/usage) using theuser's stored auth token
primary_window(e.g.3h) andsecondary_window(e.g.Day/Week)quota percentages with countdown-to-reset timers in the
/usagecommandcli.py) and Gateway (gateway/run.py) usagedisplays, gated behind
is_codex_provider()so it only activates when theagent is configured for the Codex provider
Details
CodexUsageSnapshot/CodexUsageWindow— frozen dataclasses representingthe parsed API response
fetch_codex_usage_snapshot()— injectablegetcallable for testability,handles both
reset_at(epoch) andreset_after_secondsoffset fieldsformat_codex_usage_summary()— compact one-liner for status barsformat_codex_usage_report_lines()— verbose multi-line output with planinfo for
/usagetry/except Exception: pass— silentlyskipped if Codex is not configured or auth is unavailable
Screenshots