Repository navigation
Let Codex CLI update wait for GSwitch's own work - #179
Merged
Merged
Conversation
Updating the CLI took the operation lock with a non-waiting try-lock, so clicking Update while a quota refresh was committing or running an official token refresh reported "Another GSwitch operation is in progress" even though the user had started nothing that conflicts. The update now waits for the lock the same way a quota commit does, then runs with it held. Every in-process holder is bounded by existing HTTP and App Server timeouts, and Wake keeps its own non-dismissible dialog open while it runs. The CLI busy failure can no longer occur, so its code and copy are removed.
Merged
Merged
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.
What changed
Update in the Codex CLI dialog now waits for GSwitch's own operation lock instead of failing at once. While a quota refresh or another GSwitch operation holds the lock, the update waits for it to finish, then runs
codex updatewith the lock held and the existing external-Codex check. The unreachable CLIbusyfailure code and its two strings are removed.docs/security.mdrecords the waiting behavior.Why
The maintainer reported "Another GSwitch operation is in progress" when they clicked Update without starting anything else. Their screenshot shows Refreshing x/5 in the toolbar. Quota refreshes do not set the UI's busy state, so Update stayed enabled. The backend used a non-waiting try-lock, so the update collided with a refresh's short quota commit or with an expired saved sign-in's official token refresh, which holds the lock while App Server runs.
Every in-process lock holder is bounded by existing HTTP (20 s) and App Server (15 s start, 30 s request) timeouts, and the single-instance plugin rules out a second GSwitch process. Wake keeps its own non-dismissible dialog over the window while it runs, so the CLI dialog cannot be opened behind it. No UI gate was needed.
Validation
cargo fmt --check,cargo clippy --all-targets -- -D warnings, and the full Rust suite (177 passed, 1 ignored) passed on Windows.pnpm test --exclude '.claude/**';pnpm build,pnpm run version:check, andgit diff --checkpassed.Remaining
The real
codex updatewas not run against the maintainer's installed CLI. No credentials, account state, provider protocol, or version files change.