feat: show account limits in CLI and TUI status bars - #16652
Conversation
3d88e99 to
b068f38
Compare
|
Added follow-up fix for account-limit status binding. What changed:
Local verification:
|
8afb84f to
32ffa26
Compare
|
Rebased on latest Latest local verification:
|
700cb45 to
f6aa3b2
Compare
|
Rebased this PR on the latest Current head: Local verification after the rebase:
GitHub Actions currently appear blocked for this fork PR: the check suites have Could a maintainer approve the workflow run when convenient? Also, this PR touches TUI/gateway paths in addition to CLI:
The linked issue already has |
86b80c5 to
214501b
Compare
|
Refreshed this PR again on current Current state:
What changed in the latest push:
Latest local verification:
Known baseline note:
Could a maintainer/admin please approve the fork workflow runs when convenient? They are currently all stopped with Also, this PR touches TUI/gateway paths in addition to CLI ( |
7d7e8d5 to
30422df
Compare
|
Rebased and force-pushed this PR onto current Current state:
Could a maintainer/admin please approve the workflow runs when convenient? Also, this PR touches TUI/gateway paths in addition to CLI ( |
4dcaea9 to
aafc418
Compare
2437273 to
ab643d9
Compare
6ff6cc7 to
637a457
Compare
b214165 to
8120a6e
Compare
8120a6e to
4aecc19
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for combining the CLI and TUI work. The feature still addresses a gap: current main renders account limits through /usage (cli.py:9681-9702), while the classic status bar (cli.py:5055-5119) and Ink StatusRule do not display them.
Problems
- The proposed TUI cache miss fetch is synchronous, yet the PR invokes it from both
session.infoandmessage.complete. A provider timeout would delay those hot paths rather than fail open. AccountLimitHudbypasses the establishedessentialWidth/fits()progressive-disclosure budget inui-tui/src/components/appChrome.tsx:466-533; narrow terminals can clip this new multi-window segment. The added tests cover gateway state, not narrow-width rendering.
Suggested changes
- Refresh TUI limits in a background single-flight path and emit cached/stale data only from hot RPC/response paths.
- Budget the HUD as a progressive segment and add a narrow-width render test.
- Preserve the current Codex credential-resolution safeguards in
agent/account_usage.py:439-494when resolving the stale branch conflict.
Automated hermes-sweeper review.
| @@ -488,6 +542,7 @@ export function StatusRule({ | |||
| <Text color={barColor}>[{bar}]</Text> <Text color={barColor}>{pct != null ? `${pct}%` : ''}</Text> | |||
| </Text> | |||
| ) : null} | |||
| <AccountLimitHud accountLimits={accountLimits} t={t} /> | |||
| {showDuration ? ( | |||
| <Text color={t.color.muted} wrap="truncate-end"> | |||
| {' │ '} | |||
There was a problem hiding this comment.
Please route this HUD through the same width budget as the other tail segments. essentialWidth/fits() above deliberately preserve the model and context on narrow terminals; this unbudgeted multi-window string can instead be clipped or displace those higher-priority fields. Add a narrow-width StatusRule render test with a long credential label and multiple windows.
Refresh provider usage in background with single-flight stale caching keyed to the active credential. Add compact width-budgeted Ink rendering and regression coverage for credential rotation, failures, and narrow terminals.
4aecc19 to
1b3d9b3
Compare
|
Addressed the July 12 review in Key fixes:
Verification: 228 targeted Python tests and 102 targeted Ink tests passed; typecheck, build, Ruff, ESLint, and @teknium1, please re-review when convenient. |
Summary
session.info,message.complete, and status rendering return cached/stale data immediately.ChatGPT-Account-Idonly from the already-selected live token.Example:
Codex main 5h 83% • weekly 37%.Review fixes
Addresses the July 12 review:
AccountLimitHudparticipates in the existingessentialWidth/fits()width budget.PR consolidation
This remains the combined CLI + TUI account-limit status PR and supersedes the earlier TUI-only draft #16644.
Verification
Rebuilt from current
mainat7b5ba2054721dde998ed47fd4a0f031955278e99; replacement commit:1b3d9b34c872908fab6d61bec85af3b5b7df9420.git diff --check: passed.CI status
GitHub created CI run 29208048955, but it is currently
action_required: a repository maintainer/admin must approve the fork workflow before jobs can start.Broader local-suite caveats are environment/baseline-only: the isolated gateway suite lacks a Chromium binary, while unrelated unchanged Ink tests include SSH-environment assertions and one existing timeout. All changed and newly added tests pass.
Closes #16643