Repository navigation
Conversation
With a working ChatGPT login, authenticate with chat-gpt or chat-gpt-device-code returns at once (agentclientprotocol#247), so a client cannot switch to another ChatGPT account. A client may now send _meta.replaceLogin to start the login anyway; both methods advertise it. The current account stays in place until Codex completes the new login, and a cancelled or failed login leaves it untouched.
jsulopzs
marked this pull request as ready for review
November 2, 2026 23:10
This branch has not been deployed
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
Since #247,
authenticatewithchat-gptorchat-gpt-device-codesucceeds at once when a working ChatGPT login exists. That is the right default, but it leaves a client no way to switch to another ChatGPT account: the only path islogoutfirst, which leaves the user without any login if the new sign-in is cancelled or fails.Fix
_meta: { replaceLogin: true }inauthMethods, on ACP v1 and v2.authenticatecarries_meta: { replaceLogin: true }, the adapter skips the working-login check and starts the login (account/login/start) as usual: the browser flow forchat-gpt, the URL elicitation forchat-gpt-device-code._meta.replaceLogin, nothing changes.Verification
initializeadvertisereplaceLoginon both methods. The new tests fail without the change. Build, typecheck and the full suite pass.chat-gptlogin opened the browser sign-in page; closing it without signing in left the same account in place and the session kept working.This touches the same functions as #696 (login cancellation and isolation); whichever lands second needs a small rebase.