Expose all provider accounts from serve - #2827
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 12, 2026, 11:59 AM ET / 15:59 UTC. ClawSweeper reviewWhat this changesThe branch fetches every configured token account in serve mode and groups multi-account usage into dashboard provider rows with nested account data. Merge readiness⛔ Blocked until real behavior proof is added - 9 items remain Keep open: the unchanged head still breaks the documented selected-account cardinality of the existing Priority: P2 Review scores
Verification
How this fits togetherServe mode collects provider usage into the legacy flowchart LR
A[Configured provider accounts] --> B[Serve usage collection]
B --> C[Provider account fetches]
C --> D[Usage response]
C --> E[Dashboard snapshot]
E --> F[Provider row]
F --> G[Account list]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep legacy selected-account behavior for Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible with high confidence: configure a generic provider with two token accounts and call Is this the best way to solve the issue? No—the dashboard improvement need not silently alter the established Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c4ed34d0e44a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Summary
High Level TLDR
codexbar serveexposed multiple Codex and claude-swap accounts, but ordinary token-account providers only returned theactive account. This change makes
/usagefetch every configured account and makes dashboard snapshots project thoseresults into one provider row with
accounts[], using the same configured account order and active selection as the app.Root Cause
The app menu reads all
ProviderTokenAccountData.accounts, but the headless resolver returned only the clamped activeaccount unless an interactive CLI caller explicitly passed
--all-accounts. The dashboard also disabled its existingall-account mode and only attached nested accounts through the claude-swap adapter.
Before behavior was established by source and observed route output: Codex
/usagereturned multiple rows, while ageneric provider with multiple configured accounts returned only one active row and no dashboard
accountsfield.What changed
providers[].accounts, with the active account retaining provider-level fields.accountsErrorhandling.Real behavior proof
Linux static proof completed:
git diff --check a0d77c37f9cc85d8703eb0a501c6764112f5a6e8..HEADpassed.ee0ae94e312007e63ee42b8226a7ff2e3f0e3ef8.macOS compilation, focused tests, and live fixture route output are not available from this Linux environment. The
exact macOS commands and route matrix are documented in
REPORT-IMPL.md; their copied output must be added before merge.Verification
Added
DashboardMultiAccountSnapshotTestsfor generic projection, active selection, redaction, opaque IDs, row-localfailure, collection failure, single-account compatibility, and headless all-account resolution. Updated serve cache-mode
coverage and retained the existing claude-swap snapshot suite.
Pending on macOS:
swiftformat Sources Testsswiftlint --strictswift buildmake testmake checkWhat was not tested