Repository navigation
feat: automatically switch accounts when quota is exhausted - #209
Open
lifan-builds wants to merge 2 commits into
Open
lifan-builds wants to merge 2 commits into
lifan-builds wants to merge 2 commits into
Conversation
This was referenced Oct 20, 2026
lifan-builds
marked this pull request as ready for review
October 29, 2026 03:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #207.
When the active ChatGPT account exhausts its quota, this opt-in feature selects the next saved account with freshly confirmed capacity and reuses the existing close/switch/reopen flow.
Behavior
Validation
Checks rerun on this standalone branch on October 28, 2026, after merging current upstream main:
pnpm buildpassed;pnpm testpassed (28 passed, 1 platform-specific skip);cargo test --locked --manifest-path src-tauri/Cargo.toml -- --test-threads=1passed (62 passed, 1 opt-in live test ignored); changed Rust formatting andgit diff --checkpassed.Five policy tests cover quota thresholds, credits, unknown/error results, saved-order wraparound, candidate failures, resets, source changes, cancellation, unsupported processes, and switch failures. The native race test verifies the source is checked after waiting for the authentication lock. Earlier mocked production-frontend scenarios covered close/switch/reopen ordering and failures, opt-in/off, cooldown, and source races in the combined implementation; this split reran builds and automated suites.
A full automatic switch against a real newly exhausted account has not been observed. Windows runtime and hidden-window timing outside macOS 14+ remain unverified. Enabling the feature authorizes automatic closing; unsaved Codex work can be lost, as stated in Settings.
Related contributions
Conversation recovery: #205 / #206. Direct re-login: #208 / #210. This branch targets upstream
mainindependently and contains no recovery or fork-distribution code. When merging the features together, preserve both App/Settings changes, route automatic closing through recovery when enabled, and include the re-login dialog in the monitoring pause guard.