Skip to content

fix(oauth): harden multi-account pool cooldowns, affinity eviction, and deactivated exclusion - #7844

Merged
lidge-jun merged 5 commits into
devfrom
feat/oauth-parity-wp4-pool-protection
Oct 27, 2026
Merged

lidge-jun merged 5 commits into
devfrom
feat/oauth-parity-wp4-pool-protection

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

  • Add clearGenericSessionAffinityForAccount (src/oauth/generic-session-affinity.ts) and invalidate cached presence in rotateAntigravityAccountOnAuthRefusal (src/oauth/generic-account-failover.ts) without introducing an import cycle.
  • Parse Google 429 RetryInfo.retryDelay and ErrorInfo.metadata.quotaResetDelay (extractGoogleRetryAfterSeconds in src/adapters/google-errors.ts and src/adapters/google-http.ts) so quota-exhausted 429 responses populate Retry-After when no header is present.
  • Enable Cursor preflight 401 refresh-and-replay and terminal refresh rotation across multi-account pools (FORCE_REFRESH_PROVIDERS in src/oauth/index.ts, isOAuth401ReplayProvider in src/server/responses/request-transport.ts, recoverRunTurnAdapterOnPreflight401 in src/server/responses/run-turn-execution.ts, shouldLogout / 400/401/403 (invalid_grant) classification in src/oauth/cursor.ts, and HTTP 401/403/429 matching in src/adapters/cursor/cursor-errors.ts).
  • Evict Anthropic session affinity when wasAccountAutoPaused triggers in rotateAnthropicAccountOnResponseForInstance (src/oauth/anthropic-account-refusal.ts), and classify account_deactivated and deactivated_workspace as terminal revoked refresh failures in src/codex/chatgpt-refresh-failure.ts.

Verification

  • bun test tests/oauth/generic-oauth-failover.test.ts tests/adapters/google/google-errors.test.ts tests/oauth/chatgpt-token-expiry.test.ts tests/oauth/oauth-account-auto-pause.test.ts tests/adapters/anthropic/anthropic-revoked-token.test.ts tests/providers/cursor/cursor-errors.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/import-cycle-ratchet.test.ts (275 pass, 0 fail)
  • bun run typecheck (exit 0)
  • bun run privacy:scan (Privacy scan passed)
  • bun run structure:check (structure/ SSOT checks passed)

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 27, 2026 17:44
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-27T17:44:48.924370Z 61096af PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 27, 2026
@lidge-jun
lidge-jun force-pushed the feat/oauth-parity-wp4-pool-protection branch from 61096af to 047e6a0 Compare October 27, 2026 19:05
@lidge-jun
lidge-jun force-pushed the feat/oauth-parity-wp3-google-cursor branch from eb24f20 to 67ef1d0 Compare October 27, 2026 19:05
@lidge-jun
lidge-jun changed the base branch from feat/oauth-parity-wp3-google-cursor to dev October 27, 2026 19:57
@lidge-jun
lidge-jun merged commit f4a3312 into dev Oct 27, 2026
1 of 12 checks passed
@lidge-jun
lidge-jun deleted the feat/oauth-parity-wp4-pool-protection branch October 27, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant