fix: sync official login auth across same-account profiles - #1783
Open
Rat0323 wants to merge 1 commit into
Open
Conversation
Rat0323
force-pushed
the
fix/sync-official-auth-across-profiles
branch
from
August 12, 2026 03:40
b4cb384 to
f006b5b
Compare
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.
Problem
Each relay profile stores its own
authContentssnapshot. When the ChatGPT login refreshes, Codex++ only backfills the currently active profile before switching, so other official / official+API profiles can keep stale tokens. Switching back to one of those profiles may write stale auth into~/.codex/auth.json, causing Codex to lose the refreshed login.Change
Before saving a provider switch, sync the current live ChatGPT auth into official profiles that belong to the same account:
auth.jsonis a valid ChatGPT login with a usable account identity.tokens.account_id/ JWTchatgpt_account_idwhen available.relayMode = officialprofiles, including official+API mixes.OPENAI_API_KEYbefore storing the refreshed login.The branch is rebased on the current
main; unrelated LF-normalization and macOS build-history commits are not part of this PR.Tests
cargo test -p codex-plus-core --test relay_switchcargo test -p codex-plus-core --test relay_configcargo test -p codex-plus-core --lib