Skip to content

fix(cli): mark depleted Codex quota critical - #34828

Open
edoumo wants to merge 3 commits into
NousResearch:mainfrom
edoumo:fix/codex-quota-statusbar-only
Open

fix(cli): mark depleted Codex quota critical#34828
edoumo wants to merge 3 commits into
NousResearch:mainfrom
edoumo:fix/codex-quota-statusbar-only

Conversation

@edoumo

@edoumo edoumo commented May 29, 2026

Copy link
Copy Markdown

Summary

  • Add a compact account quota badge to the classic CLI status bar.
  • Mark the badge critical/red when Codex session or weekly quota is depleted (S0% or W0%).
  • Keep the critical style in compact/overflow status bar rendering.

Test Plan

  • /usr/local/lib/hermes-agent/venv/bin/python3 -m pytest tests/hermes_cli/test_account_limits_status_bar.py tests/cli/test_cli_status_bar.py -q

Privacy / scope

This PR intentionally contains only the generic Hermes CLI quota/status-bar changes. Private Ops Center/outbox/dashboard work is excluded.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard codex labels May 29, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for splitting the account-limit badge out of the earlier mixed-scope work. Current main still exposes provider account limits through /usage (cli.py:9689-9710), while the classic status snapshot and renderers do not include an account-limit field (cli.py:4549-4653, cli.py:5063-5249). The existing Codex usage adapter already supplies Session and Weekly windows (agent/account_usage.py:497-542), so the proposal addresses a current gap without adding provider plumbing.

No correctness defect was identified in the submitted badge/cache logic by static review. Current main has evolved status-bar composition since the PR base, so maintainers will need to integrate the feature alongside the current background-subagent, prompt-elapsed, idle, and YOLO fragments (cli.py:5073-5242).

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 labels Jul 13, 2026
@edoumo
edoumo force-pushed the fix/codex-quota-statusbar-only branch from 1c37f22 to 8d3b9ee Compare July 13, 2026 22:23
@edoumo

edoumo commented Jul 13, 2026

Copy link
Copy Markdown
Author

Resynchronized this contribution onto current main (658c011).

The status-bar implementation was rebuilt against the current layout rather than mechanically rebasing the old patch, preserving the newer idle indicator, background-subagent status, resize recovery, width/overflow behavior, elapsed time, and YOLO state.

The Codex account badge remains asynchronous and cached; a depleted session or weekly quota remains visibly critical, including the overflow path. Unsupported/non-Codex providers clear a prior Codex badge instead of leaking stale state.

Validation run locally:

  • pytest tests/cli/test_account_limits_status_bar.py tests/cli/test_cli_status_bar.py tests/cli/test_cli_background_status_indicator.py tests/cli/test_cli_background_tui_refresh.py -q — 78 passed
  • ruff check cli.py tests/cli/test_account_limits_status_bar.py — passed
  • py_compile and git diff --check — passed

No deployment or active-instance change was performed.

@edoumo

edoumo commented Jul 13, 2026

Copy link
Copy Markdown
Author

Updated the Codex quota handling to classify windows by limit_window_seconds, rather than the unstable primary_window / secondary_window position.

A duration in the 6–8 day range is now treated as weekly. The status badge renders only a verified weekly window as used usage (for example W31% [███░░░░░░░]), with async cached refresh and no network I/O on the render path.

Usage-pressure styles are tested at 80%, 90%, and 95%, including fractional values before display rounding. Unknown-duration windows remain generic and are never mislabeled as weekly.

Validation: 87 focused CLI/account-usage/status-bar tests passed locally; ruff, Python compilation, and diff checks passed.

Display consumed percentage (W42%) instead of remaining (W58%). Add 10-char Unicode usage gauge. Color thresholds use raw consumed percentage. Clean stale __pycache__ on deploy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have 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