feat: add /codex-usage command - #33998
Open
Padanerd wants to merge 1 commit into
Open
Conversation
Collaborator
Padanerd
force-pushed
the
feat/codex-usage
branch
from
June 1, 2026 19:23
5a52efd to
3c91f6a
Compare
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused Codex quota command.
Problems
- Current main already renders the underlying Codex subscription windows through
/usage:cli.py:9691-9710andgateway/slash_commands.py:3965-3996call the sharedagent/account_usage.pypath. The dedicated/codex-usagesurface is still distinct, but its gateway handler must be salvaged intoGatewaySlashCommandsMixin(gateway/slash_commands.py:87); the handler location targeted by this PR was extracted fromgateway/run.py. - The added tests invoke handlers directly, so they do not verify either newly added dispatch branch.
Suggested changes
- Re-home the gateway handler in
gateway/slash_commands.pyand add CLI/gateway dispatch coverage for/codex-usage. - Preserve the shared account-usage helper, which current main hardens for Codex credential-pool resolution in
agent/account_usage.py:439-542.
Automated hermes-sweeper review.
| @@ -13910,6 +13913,23 @@ async def _handle_usage_command(self, event: MessageEvent) -> str: | |||
| return "\n".join(account_lines) | |||
Contributor
There was a problem hiding this comment.
Current main extracted in-session handlers into GatewaySlashCommandsMixin (gateway/slash_commands.py:87), where /usage now lives at line 3943. Please salvage this handler into that mixin rather than restoring a new handler in gateway/run.py.
| ) | ||
| monkeypatch.setattr("agent.account_usage.fetch_account_usage", lambda provider, base_url=None, api_key=None: snapshot) | ||
|
|
||
| cli._handle_codex_usage_command("/codex-usage") |
Contributor
There was a problem hiding this comment.
This calls the private handler directly. Add a dispatch-level assertion through process_command("/codex-usage") so the registry and CLI routing added by this PR are covered together.
Expose OpenAI Codex / ChatGPT subscription usage in CLI and gateway, including remaining percentage and reset time. Add docs and targeted tests for registry, CLI, and gateway rendering.
Padanerd
force-pushed
the
feat/codex-usage
branch
from
July 13, 2026 17:46
3c91f6a to
6658515
Compare
This was referenced Jul 30, 2026
Open
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
Verification