fix(usage): distinguish Codex workspaces by account ID - #10876
fix(usage): distinguish Codex workspaces by account ID#10876kalvenschraut wants to merge 1 commit into
Conversation
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This cross-package runtime change reads authentication state, alters Codex quota request identity, and changes shared web/mobile aggregation and reset-credit matching for subscription workspaces. Those authentication and entitlement effects extend beyond a small isolated bug fix. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughCodex account IDs are read from file-backed authentication, propagated through provider and API account data, and used to keep distinct workspace subscriptions separate in usage-limit pooling. ChangesCodex account identity
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Codex workspaces sharing an email now remain separate when their account IDs differ, while matching workspaces continue to pool usage and reset credits across reports. No material merge-readiness risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What changed
Codex workspaces sharing an email address are currently merged into one quota bucket, even when they have separate subscriptions. Carry the workspace account ID from native file-backed authentication and CLIProxyAPI into the shared quota collectors. The same workspace still merges across environments and native/hub reports, and reset credits stay attached to the matching workspace.
Email remains the fallback for older servers and providers without an ID. An email-only report joins an identified workspace only when the match is unambiguous; otherwise it stays separate rather than guessing.
Fixes #10835.
Related: #10845 distinguishes accounts by email and plan. That leaves two Business workspaces with the same email and plan merged. A workspace ID distinguishes that case without treating a plan change as a new subscription.
UI
Synthetic fixture captures in the web client: two Business workspaces share an email, with 10% and 80% remaining. One workspace is reported on both Laptop and Desktop. Before, both workspaces collapse into 10%; after, they remain separate and pool to 45%.
Verification
Implemented with GPT-6 in Codex; reviewed with claude-fable-5-1 through Claude Code.
Summary by CodeRabbit
New Features
Bug Fixes