Skip to content

fix: restore Codex usage window reporting - #34978

Open
e2websolutions wants to merge 1 commit into
NousResearch:mainfrom
e2websolutions:fix/codex-usage-windows
Open

fix: restore Codex usage window reporting#34978
e2websolutions wants to merge 1 commit into
NousResearch:mainfrom
e2websolutions:fix/codex-usage-windows

Conversation

@e2websolutions

Copy link
Copy Markdown

Summary

  • Parse OpenAI Codex 5-hour and weekly usage window headers
  • Show 5h/weekly usage and reset times in /usage again
  • Restore CLI statusbar indicators for provider usage windows
  • Add regression tests for Codex percent headers and x-ratelimit aliases

Test Plan

  • venv/bin/python -m pytest tests/agent/test_rate_limit_tracker.py tests/cli/test_cli_status_bar.py -q
  • venv/bin/ruff check agent/rate_limit_tracker.py cli.py tests/agent/test_rate_limit_tracker.py tests/cli/test_cli_status_bar.py
  • git diff --check

Parse OpenAI Codex five-hour and weekly usage headers and render their usage/reset windows in /usage and the CLI status bar. Add regression coverage for Codex percent headers and x-ratelimit window aliases.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard provider/openai OpenAI / Codex Responses API labels May 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for restoring visibility into Codex limits. Current main already implements the /usage portion through the Codex account-usage API, but the status-bar portion remains absent.

Problems

  • agent/account_usage.py:497-542 is now the Codex source of truth: it fetches /wham/usage and maps primary/secondary windows to Session/Weekly. Current /usage already renders tracker output at cli.py:9647-9653, then account usage at cli.py:9689-9710; adding a second Codex header representation would create parallel usage blocks when both sources are available.
  • The status-bar implementation has moved to the snapshot/render flow at cli.py:4563-4653 and cli.py:5063-5127. The current snapshot has no provider-limit field, and GitHub reports this PR as conflicting.

Suggested changes

  • Rework the status-bar addition around one cached account-usage representation rather than adding a second Codex-specific rate-limit model.
  • Add tests for the current snapshot, text, and fragment renderers, preserving the existing Codex Session/Weekly endpoint tests in tests/agent/test_account_usage.py.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform area/usage-cost Token accounting, usage reporting, billing, cost tracking labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/usage-cost Token accounting, usage reporting, billing, cost tracking comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/openai OpenAI / Codex Responses API sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants