Skip to content

feat(widgets): add Codex Usage widget - #1031

Open
GilbertrdzDev wants to merge 1 commit into
amnweb:mainfrom
GilbertrdzDev:feature/codex-usage-widget
Open

feat(widgets): add Codex Usage widget#1031
GilbertrdzDev wants to merge 1 commit into
amnweb:mainfrom
GilbertrdzDev:feature/codex-usage-widget

Conversation

@GilbertrdzDev

Copy link
Copy Markdown

Summary

  • Adds a new Codex Usage widget (yasb.codex_usage.CodexUsageWidget) that polls the Codex CLI's ChatGPT usage endpoint (rate_limit.primary_window/secondary_window) using the local ~/.codex/auth.json credentials, mirroring the existing Claude Usage widget's UX (menu popup, toggle label on right-click showing the 5h reset time).
  • Adds the corresponding validation schema (CodexUsageConfig), regenerates schema.json, and documents the widget in docs/widgets/(Widget)-Codex-Usage.md (linked from docs/_Sidebar.md).
  • Fixes a shared UsageBar._update_fill rounding bug (also patched in claude_usage.py) where the progress pill collapsed into a circle instead of a pill at low fill widths.

Test plan

  • Ran from source (python src/main.py) and confirmed the widget renders in the bar with live usage data.
  • Verified left-click opens the usage menu popup and right-click toggles to the reset-time alt label.
  • Verified ruff format --check . and ruff check . pass.
  • Regenerated schema.json via python src/core/validation/export_schema.py.
  • Built and ran the packaged yasb.exe/MSI locally to confirm the widget also works outside dev mode.

Adds a new yasb.codex_usage.CodexUsageWidget mirroring the existing
Claude Usage widget, polling the Codex CLI's ChatGPT usage API
(rate_limit.primary_window/secondary_window) via the local
~/.codex/auth.json credentials, with a menu popup and reset-time
toggle label. Also fixes a rounding bug in UsageBar._update_fill
shared with claude_usage.py where the progress pill collapsed to a
circle at low fill widths.
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.

1 participant