fix(usage): distinguish Codex workspaces by account ID - #10876
kalvenschraut 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 (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 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
Estimated code review effort: 4 (Complex) | ~45 minutes Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant CodexAuth
participant CodexProvider
participant UsageLimits
CodexAuth->>CodexProvider: read accountId from auth.json
CodexProvider->>UsageLimits: provide provider auth accountId
UsageLimits->>UsageLimits: merge native and hub reports by accountId
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change separates Codex subscriptions that share an email while preserving pooling for the same workspace and compatibility with older reports. The supplied validation covers the affected identity and quota paths, so it is merge-ready. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2b1fdae to
bcbb186
Compare
|
Might just be me, but those percentage bars need to be stacked vertically instead of horizontally. I can't imagine what that would look like on a small screen. Waiting no this fix btw |
|
Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work. Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look. |
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, and group by workspace ID plus normalized email. Different Business members can share a workspace ID while owning different quotas and reset credits. 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. Workspace ID plus email 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%.
A second synthetic fixture uses two members of the same Business workspace. Before, only the primary member's 29% quota appears. After, the review member's 77% quota and three reset credits remain separate from the primary member's one credit.
Verification
Implemented with GPT-6 in Codex; reviewed with claude-fable-5-1 through Claude Code.
Summary by CodeRabbit
New Features
Bug Fixes