Repository navigation
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
acb88ff to
aeedd5e
Compare
|
Our contribution guidelines state that we're not accepting feature contributions at this time. We need to make sure that all new features are well designed, compose well with both existing and upcoming features, fit into our roadmap, and are consistent across all Codex surfaces (CLI, IDE extension, web). If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback. |
|
Thanks for the clarification. I’m disappointed that’s the current approach, but I understand the policy. I’ll move the details to the enhancement issue and add any extra context there. |
OAuth Marathon 🏃 — Keep running when you hit the wall. Automatic credential rotation for Codex OAuth: when one account hits rate limits or auth errors, Codex seamlessly switches to your next available ChatGPT credential.
The Problem
Codex currently stores a single ChatGPT OAuth credential. When that account hits rate limits or encounters auth refresh failures, long sessions are interrupted and require manual re-login or switching to an API key.
Proposed Solution
How to Add Multiple Accounts
Architecture Overview
graph TD A[Codex Client Request] --> B{OpenAI + ChatGPT auth?} B -- no --> Z[Use existing auth path] B -- yes --> C[OAuthRotationPlan] C --> D[Auth Store v2] D --> E[Ordered OAuth Records] E --> F{Pick Next Candidate} F -->|Ready| G[Send Request] G --> H{Response} H -->|200| I[Record Success] H -->|401/403| J[Refresh Once + Retry] H -->|429| K[Cooldown by Retry-After] H -->|402/other| L[Cooldown / Exhaust] H -->|Network/Timeout| M[Retry Same Account] J --> N{Retry Result} N -->|OK| I N -->|Fail| O[Rotate + Mark] K --> O L --> O M --> O O --> FUse Cases
Demo
codex login accountscore/tests/suite/oauth_rotation.rs.Why
Refs #9648.
Tests
just fmtjust fix -p codex-corejust fix -p codex-clijust write-config-schemaPATH=/bin:/usr/bin:/usr/local/bin:/opt/homebrew/bin cargo test -p codex-corecargo test -p codex-cli