fix: reconcile live auth and improve release UX - #135
Merged
Conversation
Reject live token synchronization unless stored and live credentials resolve to the same ChatGPT account. Derive identity from legacy stored ID tokens when possible.
Reconcile the active profile from Codex auth.json while Codex is running. Avoid rotating its refresh token and allow metadata and usage requests to continue with the live session.
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.
Summary
auth.jsoncredentials to resolve to the same ChatGPT account ID before synchronizing tokens.Why
PRs #128 and #134 fixed stale refresh-token restoration and expired ID tokens during account switching.
This follow-up addresses two remaining problems:
Live credentials could be copied into a stored profile when the stored account identity was unknown.
Refreshing usage for the active account failed while Codex was running with:
Cannot refresh the active account while Codex/ChatGPT is runningThe active account now uses credentials already refreshed by the running Codex app. Codex Switcher does not attempt to rotate that account's refresh token.
Validation
cargo test --manifest-path src-tauri/Cargo.toml— 47 passedcargo clippy --manifest-path src-tauri/Cargo.toml --all-targets— completed with 11 pre-existing warningspnpm buildgit diff --checkRelated