Skip to content

(codex): opt-in Codex usage gauge - #1161

Merged
devsuitup merged 4 commits into
mainfrom
feat/1139-codex-usage-gauge
Nov 21, 2026
Merged

devsuitup merged 4 commits into
mainfrom
feat/1139-codex-usage-gauge

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Closes #1139

Port of the Codex usage gauge from upstream, by Ali Basiri (doctly/switchboard ee656523 and 3ca3d19d), behind an opt-in switch as decided on 2026-10-28.

  • Settings › Sessions › CLI Agents: Show Codex usage, off by default (SETTING_DEFAULTS).
  • Off: main never reads auth.json and never calls the endpoint; no gauge.
  • On: the token is read main-side only (from CODEX_HOME or ~/.codex), never logged, never sent to the renderer; requests time out and back off after a failure or a 429; any failure hides the gauge quietly. The renderer receives only the rows it renders, in the sidebar gauge and in Stats.
  • Toggling takes effect without a restart.

Tests use a fake auth file and a stubbed endpoint: test/codex-usage.test.js, test/codex-usage-ipc.test.js, test/codex-usage-renderer.test.js.

Port of the upstream Codex usage reader behind a Settings switch that is off
by default: the token is read main-side only, requests time out and back
off, and any failure hides the gauge.
Turning the setting off only hides the Codex rows, a save refreshes usage
only when the setting changed, the request headers are pinned, rows above
100% are kept, and the docs name the status bar gauge.
…usage setting

The quota gauge clears its static placeholders again, Stats honours the
renderer's Codex state, an unrendered toggle no longer turns Codex off, and
a deferred turn-on refreshes once the save is applied.
@devsuitup
devsuitup merged commit 28e7d13 into main Nov 21, 2026
6 checks passed
@devsuitup
devsuitup deleted the feat/1139-codex-usage-gauge branch November 21, 2026 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(codex): opt-in Codex usage gauge

1 participant