Skip to content

Track Codex credit usage in the dashboard and side notch - #45

Open
pekth wants to merge 1 commit into
mainfrom
feat/codex-credit-tracker
Open

pekth wants to merge 1 commit into
mainfrom
feat/codex-credit-tracker

Conversation

@pekth

@pekth pekth commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Codex reports a remaining credit balance but MeterUsage did not track changes in that balance or show credits beside subscription windows in the side-notch card. This adds a compact balance and observed-use section to both the quota and side-notch hover cards, with an on/off switch in Settings → Pacing & Telemetry.

Each account keeps a separate local total. Turning tracking off hides the credit rows and pauses recording; turning it back on keeps the total and starts a fresh baseline. Top-ups do not count as usage. The measure records sampled balance decreases, so top-ups can mask spending and expiry can also lower balances. It does not reconstruct a billing ledger. Existing quota calls supply the data; no extra requests or credential reads are added. Demo usage is synthetic and never changes saved totals.

Validation on macOS:

  • swift build passed.
  • swift test passed: 385 tests, 0 failures. New scenarios cover per-account totals, top-ups, duplicate/older readings, unavailable/invalid balances, pause/resume, relaunch persistence, demo isolation, and unreadable saved data.
  • Scripts/make-app.sh passed, including strict ad-hoc signature verification.
  • Staged diff and credential checks passed; touched Markdown links resolve. scripts/documentation.py is absent from this repository.
  • Design review chose balance first, observed use below, and a short start date, with no percentage meter for an unknown credit budget.

Native visual acceptance is blocked. The Mac is online, and candidate sources match the reviewed commit. The temporary capture helper compiled but could not enumerate the SwiftUI accessibility tree. One bounded helper correction produced the same failure, so capture attempts stopped. No screenshots were produced. Two-provider captures and a native on/off UI check remain required before release. The temporary helper was removed. The candidate was not installed or deployed.

Model(s): GPT-6.1-Sol (implementation), GPT-6-Luna (design review)
Harness: T3 Code / Codex

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