fix(codex): scope profile quota reads and explain Pro (More) usage - #144
Merged
Merged
Conversation
Use Codex's account header for usage requests, identify the Pro (More) plan accurately, and disclose that the dashboard keeps the usage API percentage unchanged when it differs from CLI /status. No upstream conversion rule is available, so the raw value remains authoritative for tracking. Constraint: Codex v0.159.0 displays the API-reported percentage directly and scopes usage reads with ChatGPT-Account-Id Rejected: Divide Pro utilization by two | no documented conversion rule and the behavior could misstate other plans or future API responses Confidence: medium Scope-risk: narrow Directive: Preserve API percentages unless Codex documents a supported conversion Tested: ./app.sh --test; ./app.sh --smoke; node --check internal/web/static/app.js; git diff --check Not-tested: Live OAuth comparison against the reporter's Pro (More) account
Named profile clients were missing the account metadata needed by the new usage header, and the single-account All view omitted the source disclosure. Forward account IDs to usage clients, carry the note and plan label through every account view, and count quota articles independently of the note when laying out tablet cards. Use GPT-6 Luna for the tiny starter request. Constraint: No supported conversion rule explains the API/CLI percentage difference Rejected: Halve Pro utilization | could misstate current or future server limits Directive: Keep usage metadata scoped to each profile and preserve API percentages Confidence: high Scope-risk: narrow Tested: app.sh full race suite and smoke checks; eight isolated browser regressions; JavaScript syntax; gofmt and diff checks Not-tested: Live reporter account comparison and live GPT-6 Luna window anchoring Related: #142
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Use the canonical account header for usage requests and guard default-profile credential adoption and saving against identity changes. Preserve token rotation without metadata and retain the latest token when a login changes. Supply plan labels from the existing server formatter, refresh changing source notes, and escape legacy account names in both text and attributes. Constraint: Usage requests must follow Codex's ChatGPT-Account-Id convention Rejected: Keep alternate account headers | upstream does not use them Directive: Do not replace the tracked profile token with a different login or stale startup token Confidence: high Scope-risk: moderate Tested: Targeted race tests through app.sh; vet and macOS production build; seven Node VM renderer checks; syntax, gofmt and diff checks Not-tested: Full socket suite and browser cases under the current sandbox; live OAuth quota comparison and Luna window anchoring Related: #144
The spawned shell creates the marker with O_TRUNC before printf writes, so the polling loop could read a transient 0-byte file and fail the test immediately. Treat an empty read as "not yet" and keep waiting; only a non-empty value that disagrees with the expected marker is a failure. This is why Test (Windows) failed on CI while the same commit passed on Linux and macOS: Windows shell startup is slower, widening the window. Tested: go test -race -count=50 ./internal/update/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex Pro (More) can report 87% weekly usage through
wham/usagewhile a CLI stream reports 43-44% for the same reset. onWatch now scopes named-profile usage requests withChatGPT-Account-Id, uses Codex's plan labels, and shows a source disclosure in both the Codex and All Providers views. API percentages are preserved because no supported conversion rule is established.Restores tablet card placement when the disclosure precedes quota cards, and switches the quota-starter default to
gpt-6-luna. TheCODEX_STARTER_MODELoverride remains available; the setup guide no longer recommends retired models.Validation:
./app.sh --test --smokepassed: full race suite, vet, macOS production build check, and short tests.pytest --confcutdir=tests/e2e/tests --browser-channel=chrome tests/e2e/tests/test_codex_usage.py. This excludes the parent daemon fixtures for local validation.The reporter's live account discrepancy and actual window anchoring with Luna were not reproduced. This addresses the issue's request for clear disclosure when the usage API and CLI differ.
Fixes #142