Repository navigation
Connect your AI: inside OpenBot Desktop, Claude and ChatGPT finish their sign-in with no paste - #2039
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 22, 2026 19:31
davidmckayv
force-pushed
the
app/sign-in-redirect-in-desktop
branch
from
November 22, 2026 19:45
63e58b8 to
7aaaec2
Compare
…eir sign-in with no paste Signing in to a Claude or ChatGPT plan from Connect your AI made the person copy and paste: Claude's code, or the address of ChatGPT's page that won't load. Inside OpenBot Desktop it no longer does. Desktop listens on the person's own computer for the provider's redirect, as other apps do, and the app sends what arrives on to the server, which keeps the sign-in exactly as before. - Claude: Desktop picks a port (begin_sign_in_redirect), the server is told it (loopbackPort) and sends Claude's redirect there, and the code and state that arrive go on as code#state. - ChatGPT: the browser sign-in comes first inside Desktop. Its redirect is always localhost:1455/auth/callback, where Desktop listens, and the address built from what arrived goes on as a person would have pasted it. The code sign-in stays as the other way. - While it waits there is no paste box and no "This site can't be reached" warning: approve in the browser and OpenBot finishes on its own. Cancel, Back, another provider or way, and leaving the screen each stop Desktop listening (cancel_sign_in_redirect). - Anything that stops it falls back to today's paste: an OpenBot Desktop without the commands or with no free port, a server that refuses loopbackPort (400, retried without it), or a sign-in page that doesn't send the browser to Desktop. - In a plain browser nothing changes: Claude's paste, and ChatGPT's code first. The Desktop commands' wrappers and the rules (when the redirect is taken, what is sent, each fallback) are in app/src/lib/ai-connection/sign-in-redirect.ts, with unit tests. The browser test of Connect your AI drives each flow against a Desktop stub that answers the three commands and the server's sign-in endpoints as the server answers them, in Chromium and WebKit.
…rst, as it does today Where Desktop can't take ChatGPT's redirect (a Desktop without the commands, or port 1455 busy), the chooser fell back to the browser sign-in's address paste. That changed the first way for someone on an older Desktop, who today signs in with a code. It now falls back to exactly that: the code sign-in starts at once with today's screens, and the address paste stays the other way. Claude's fallback is unchanged, since its code paste is what it does today.
davidmckayv
force-pushed
the
app/sign-in-redirect-in-desktop
branch
from
November 22, 2026 19:57
7aaaec2 to
764d54d
Compare
This was referenced Nov 22, 2026
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.
Signing in to a Claude or ChatGPT plan from Connect your AI made the person copy and paste: Claude's code, or the address of ChatGPT's page that won't load. Inside OpenBot Desktop it no longer does. Desktop listens on the person's own computer for the provider's redirect, as other apps do, and the app sends what arrives on to the server, which keeps the sign-in exactly as before.
What changes
begin_sign_in_redirect), the server is told it (loopbackPort, from API: a Claude sign-in can redirect to OpenBot Desktop's loopback port #2035) and sends Claude's redirect there, and the code and state that arrive go on withfinishPersonalAiSignInascode#state.localhost:1455/auth/callback, where Desktop listens, and the address built from what arrived goes on as a person would have pasted it. The code sign-in stays as the other way.cancel_sign_in_redirect).loopbackPort(400, retried without it), or the sign-in page doesn't send the browser to Desktop. For ChatGPT, when Desktop lacks the commands or port 1455 is busy, its code sign-in starts at once as the first way, with the address paste still the other way; never the address paste first.It does not depend on the Desktop commands being released: an older Desktop rejects them and the chooser falls back to today's sign-in.
Where
app/src/lib/ai-connection/sign-in-redirect.ts: typed wrappers for the three Desktop commands, and the rules (when the redirect is taken, what is sent, each fallback).app/src/lib/ai-connection/mutations.ts:startPersonalSignIntakesloopbackPort.app/src/components/settings/ai-connection-chooser.tsx: the flow and the screens.Tests
app/tests/sign-in-redirect.test.ts: the rules, against the provider pages the server builds: Desktop vs browser,code#statevs the whole address, a decline, a timeout, and each fallback (Desktop refuses, 400 on the port, a page not sent to Desktop).app/tests/connect-your-ai.test.tsx: in a real browser, with a Desktop stub answering the three commands and the server's sign-in endpoints answered as the server answers them. Claude and ChatGPT reach signed in with no paste box ever shown, the server receivescode#stateand the whole address, cancel and leaving stop Desktop listening, and each fallback lands on today's paste. The plain-browser tests are unchanged and pass. Run in Chromium and WebKit; red on the base branch (10 of 10 Desktop tests fail), green here.