CodexBar icon indicating copy to clipboard operation
CodexBar copied to clipboard

Codex web dashboard rejects authorized credits-only snapshots

Open soumikbhatta opened this issue 6 months ago • 1 comments

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/session returned 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.makeAuthorizedDashboardResultForTesting reproduces 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 CodexWebDashboardStrategyAuthorityTests
  • make check
  • TZ=UTC swift test

soumikbhatta avatar May 29 '26 03:05 soumikbhatta

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:

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-review comments, 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-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to 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 explain to ask for more context, or @clawsweeper stop to stop active automation.

clawsweeper[bot] avatar May 29 '26 03:05 clawsweeper[bot]