fix: sync official login auth across same-account profiles - #1783
Open
Rat0323 wants to merge 3 commits into
Open
fix: sync official login auth across same-account profiles#1783Rat0323 wants to merge 3 commits into
Rat0323 wants to merge 3 commits into
Conversation
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 keep stale tokens. Switching back to one of those profiles writes the stale auth into~/.codex/auth.json, and Codex drops the login.Change
Before saving a provider switch, sync the current live ChatGPT auth into official profiles that still belong to the same account:
auth.jsonis a valid ChatGPT login.relayMode = officialprofiles (includes official+API mixes).OPENAI_API_KEYbefore storing, so mixed-API keys stay in the provider config rather than auth.Tests
cargo test -p codex-plus-core --test relay_switchcargo test -p codex-plus-core --test relay_configWindows test note
This PR includes the same
.gitattributesLF normalization for upstream theme assets as #1771, which is intended to keep the byte-exact theme asset checks green on Windows checkouts. The macOS x64 artifact job can fail transiently withhdiutil: create failed - Resource busy; that failure is unrelated to this change.One open design question for maintainers: should
authContentsintentionally support a different official account per profile? This PR preserves that case when the account label differs; if per-account binding is not intended, this also fixes stale logins for the common single-account flow.