Codex web dashboard rejects authorized credits-only snapshots
Summary
Codex web dashboard refresh can fail the whole provider when the authenticated dashboard snapshot has credits/account data but no usage-limit windows yet. CLI/OAuth paths already preserve credits-only responses; the web path throws .missingUsage.
Evidence
- CodexBar 0.31.0 on macOS.
- OpenAI web auth was valid:
/api/auth/sessionreturned 200 and the dashboard signed-in email matched the Codex account. - The menu could show Codex cost/credits data, but the Codex usage header stayed at "Not fetched yet" during the partial web state.
- Local log showed dashboard parsing reached authenticated dashboard content but failed on missing/non-usage chart data:
usage breakdown error: Only non-usage chart candidates found: Daily threads by client, Daily skill invocations. - A regression test against
CodexWebDashboardStrategy.makeAuthorizedDashboardResultForTestingreproduces the failure: authorized dashboard +creditsRemaining+ no primary/secondary limits currently throws.missingUsage.
Expected
When ownership is authorized and credits are present, Codex web should return a partial usage result with nil limit windows plus credits/identity, matching the existing CLI/OAuth credits-only fallback behavior.
Actual
The authorized web dashboard result throws .missingUsage, which can surface as a failed Codex fetch / "Not fetched yet" instead of preserving useful dashboard data.
Proposed fix
If dashboard.toUsageSnapshot(...) returns nil but dashboard.toCreditsSnapshot() exists, create a credits-only UsageSnapshot with the authorized identity and attach the dashboard/credits.
Validation plan
swift test --filter CodexWebDashboardStrategyAuthorityTestsmake checkTZ=UTC swift test
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 28, 2026, 11:33 PM ET / 03:33 UTC.
Summary Keep open: current main still rejects this credits-only Codex web dashboard state, and the linked same-author fix PR at https://github.com/steipete/CodexBar/pull/1206 already owns the implementation path.
Reproducibility: yes. A focused source-level reproduction is an authorized dashboard snapshot with creditsRemaining set and no primary or secondary limits passed through makeAuthorizedDashboardResultForTesting; current main throws .missingUsage before preserving credits.
Next step An open same-author PR with closing syntax already owns the narrow fix, so this issue should stay open until that PR lands or is closed.
Review details
Best possible solution:
Review and land https://github.com/steipete/CodexBar/pull/1206, or an equivalent narrow fix, so authorized web dashboard credits are preserved when usage windows are absent.
Do we have a high-confidence way to reproduce the issue?
Yes. A focused source-level reproduction is an authorized dashboard snapshot with creditsRemaining set and no primary or secondary limits passed through makeAuthorizedDashboardResultForTesting; current main throws .missingUsage before preserving credits.
Is this the best way to solve the issue?
Yes. The proposed direction is narrow and matches existing OAuth behavior: after authority attaches the dashboard, synthesize a partial credits-only result instead of failing the provider.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- The linked fix has not merged, so current main and the latest release still have the reported credits-only web rejection path.
- Validation was source-based in this read-only review; the proposed regression test was not executed here.
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6fe01054424b.
Label changes
Label changes:
- add
P2: This is a normal-priority provider refresh bug with a bounded Codex web dashboard surface and an open focused fix PR. - add
impact:auth-provider: The bug is in authorized Codex web dashboard provider handling and can make valid account data look like a failed fetch. - add
issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label. - add
clawsweeper:source-repro: Current issue advisory state selects this label.
Label justifications:
P2: This is a normal-priority provider refresh bug with a bounded Codex web dashboard surface and an open focused fix PR.impact:auth-provider: The bug is in authorized Codex web dashboard provider handling and can make valid account data look like a failed fetch.
Evidence reviewed
What I checked:
- Current web strategy throws before preserving credits: In the attach branch,
makeAuthorizedDashboardResultrequiresdashboard.toUsageSnapshot(...)and throwsOpenAIWebCodexError.missingUsagebefore readingdashboard.toCreditsSnapshot(). (Sources/CodexBarCore/Providers/Codex/CodexWebDashboardStrategy.swift:220, 6fe01054424b) - Usage projection does not allow credits-only snapshots:
CodexReconciledState.makereturns nil unless normalized primary or secondary windows exist, so attached dashboard credits do not maketoUsageSnapshotsucceed. (Sources/CodexBarCore/Providers/Codex/CodexReconciledState.swift:92, 6fe01054424b) - Credits can be projected separately:
OpenAIDashboardSnapshot.toCreditsSnapshot()returns aCreditsSnapshotwhencreditsRemainingexists, independent of usage-window projection. (Sources/CodexBarCore/OpenAIDashboardModels.swift:143, 6fe01054424b) - Existing OAuth path preserves credits-only results: The OAuth tests already expect a payload with null primary and secondary windows plus a credits balance to return nil usage windows and a credits result. (
Tests/CodexBarTests/CodexOAuthTests.swift:566, 6fe01054424b) - Linked fix PR is open: GitHub context shows https://github.com/steipete/CodexBar/pull/1206 uses closing syntax for this issue;
git ls-remoteconfirms its head SHA is still available. (2c6a4b2e4d5b) - Relevant history: Blame attributes the current attach/throw path to release commit f83fb70b7f2427d25460eb283e817237710bddc5. (
Sources/CodexBarCore/Providers/Codex/CodexWebDashboardStrategy.swift:205, f83fb70b7f24)
Likely related people:
- Peter Steinberger: Blame on the Codex web dashboard attach path and dashboard projection helpers points to the release commit that introduced the current main behavior. (role: introduced current behavior / recent area contributor; confidence: high; commits: f83fb70b7f24, 6fe01054424b; files:
Sources/CodexBarCore/Providers/Codex/CodexWebDashboardStrategy.swift,Sources/CodexBarCore/OpenAIDashboardModels.swift) - soumikbhatta: The reporter opened the linked PR that targets this exact credits-only web dashboard path. (role: reporter and linked fix PR author; confidence: medium; commits: 2c6a4b2e4d5b; files:
Sources/CodexBarCore/Providers/Codex/CodexWebDashboardStrategy.swift,Tests/CodexBarTests/CodexWebDashboardStrategyAuthorityTests.swift)
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.