feat: show Codex session reset in status bar - #44506
Conversation
|
Hi! I wanted to add a little more context on the UX/safety side of this change. This is intended to make Codex session limits glanceable/actionable in the CLI status bar, similar to the existing background-task, compression, and idle-time indicators. The indicator is intentionally quiet: it is hidden unless the current provider is A few implementation details to avoid status-bar risk:
The goal is to keep this compact and actionable: users can see whether they are close to the Codex session limit and when it resets without needing to interrupt flow with Validation included in the PR:
Happy to adjust the placement/wording, add more layout coverage, or add TUI parity if that is preferred. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused cached-status-bar design. The feature is still absent on current main: cli.py:4549-5251 has no account-usage snapshot or Codex quota segment.
Problems
- The credential fallback in the PR is no longer safe to carry forward. Its broad
except Exceptioncan turn a transient resolver failure into a pool lookup for a different account. Current main intentionally narrows this atagent/account_usage.py:459-480; regression tests attests/agent/test_account_usage.py:121-194require fail-open behavior and preservation of the resolved singleton token. This hardening landed in130e2337c.
Suggested changes
- Salvage the status-bar feature onto the current snapshot/width-tier paths in
cli.py:4549-5251, but retain current_resolve_codex_usage_credentials(). - Add coverage in the current status-bar suite,
tests/cli/test_cli_status_bar.py, including width fallback and refresh behavior.
This is an automated hermes-sweeper review.
| try: | ||
| token_data = _read_codex_tokens() | ||
| tokens = token_data.get("tokens") or {} | ||
| account_id = str(tokens.get("account_id", "") or "").strip() or None |
There was a problem hiding this comment.
Do not catch every resolver/token-read failure here and then fall back to the pool: a transient resolver failure can display another pooled account's quota. Current main's agent/account_usage.py:459-480 intentionally limits pool fallback to AuthError and preserves a successfully resolved token when only the account-id read fails.
2e387b5 to
dc41cae
Compare
|
Updated this against current The focused status-bar and account-usage suite passes locally (105 tests), along with Ruff, compile, and diff checks. The new CI run is waiting for maintainer approval: https://github.com/NousResearch/hermes-agent/actions/runs/29468566648 |
dc41cae to
41231d5
Compare
Summary
Adds a compact, cached OpenAI Codex session-limit segment to the classic CLI status bar, for example
Codex 44% reset 4h 38m.The indicator makes current-session pressure visible without interrupting work to run
/usage.Behavior
openai-codex>=76columns)/usageremains the detailed synchronous viewStatus-bar safety
chatgpt.comCodex endpointChanges
cli.py: adds cached Codex usage state, nonblocking refresh, compact formatting, and wide-tier renderingtests/cli/test_cli_status_bar.py: covers percentage/reset formatting, invalid values, provider switching, width fallbacks, styling, single-flight refresh, rate limiting, active credentials, successful refreshes, and failure behaviorThe current credential-resolution implementation in
agent/account_usage.pyis preserved unchanged.Test Plan
python -m pytest tests/cli/test_cli_status_bar.py tests/cli/test_cli_background_status_indicator.py tests/cli/test_cli_background_tui_refresh.py tests/agent/test_account_usage.py -q --tb=short -n 0 -o 'addopts='105 passedpython -m compileall -q cli.py tests/cli/test_cli_status_bar.pyuvx ruff check cli.py tests/cli/test_cli_status_bar.pygit diff --check