Key Claude OAuth rate-limit backoff per seat - #403
Conversation
SBS-1064: a 429 on one directory seat no longer pauses other Claude accounts via a process-global RATE_LIMIT_BACKOFF_UNTIL instant. Co-authored-by: Tyler <tyler@southboundsoftware.com>
|
Warning Review limit reachedNext included review available in 50 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | a36ae64 | Commit Preview URL Branch Preview URL |
Aug 23 2026, 10:25 PM |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f72ba099-4502-41b8-a0a2-83bc7783087e) |
Summary
Claude OAuth
RATE_LIMIT_BACKOFF_UNTILwas a single process-wideInstant. A 429 on one directory seat paused every other Claude seat in the same process, including seats that only share a login email across orgs.Backoff is now keyed by the same directory-seat identity used for account isolation and post-SBS-1057 predictive pace (
dir_keyofCLAUDE_CONFIG_DIR). AmbientNoneresolves to the CLI's current config dir so an explicit ambient path is the same seat.two_directory_seats_do_not_share_oauth_rate_limit_backofffailed on the process-global gate with:a 429 on one directory seat must not pause the otherand passes after the keyed map.
Related issue
Fixes SBS-1064
Affected areas
Validation
Hosted CI passed on this branch (Frontend, Rust / shared, Rust / desktop, required Rust aggregator, CodeQL).
Local Linux cloud agent:
cargo fmt --all --checkcargo test --manifest-path rust/Cargo.toml— 1188 lib + 32 bin tests passed, including the new two-seat isolation testscargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings— failed on pre-existing Linux-only unused items insecure_file.rs/updater.rs(Windows-gated). Hosted Windows clippy passed.cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml— missinggdk-3.0locally. Hosted Windows desktop job passed. Desktop crate was not changed.scripts\local-check.ps1— PowerShell, not available hereUI / tray proof
Notes for reviewers
Sibling process-global OAuth / rate-limit sweep:
RATE_LIMIT_BACKOFF_UNTILwas the only process-global Instant gate in Claude OAuth.REFRESHED_CREDENTIALSis already keyed byCredentialSource(file path / env / keyring).oauth/refresh.rs) has no backoff gate.RATE_LIMIT_BACKOFF_UNTIL.Do not merge; this PR is for review.
Note
Track Claude OAuth rate-limit backoff per seat instead of globally
RATE_LIMIT_BACKOFF_UNTILfromOnceLock<Mutex<Option<Instant>>>toOnceLock<Mutex<HashMap<String, Instant>>>keyed by a canonicalized config-directory identity.rate_limit_seat_keyto resolve the seat key from the fetcher's explicitconfig_diror the ambient Claude config dir, usingdir_keyfor canonicalization (trailing separators stripped, lowercased on Windows).fetch_usage,record_rate_limit,clear_rate_limit, andrate_limit_backoff_remainingto operate on per-seat entries rather than a single global timer.dir_keyin account_dirs.rs to confirm the canonicalization matches all caller expectations.Macroscope summarized a36ae64.