master
John Lauer login recipe: x.com (bring the session over; pup-bridge#136) 0ed61c7 14d ago

x.com (Twitter): sign in by bringing the session over

Short version: X refuses a fresh sign-in from pup's browser, so carry the user's existing X session over from their own Chrome or Edge instead:

adom-bridge --ai-thread "<your thread>" pup_open_window '{"url":"https://example.com"}'   # any pup window, if none is open
adom-bridge --ai-thread "<your thread>" pup_import_browser_logins '{"sessionFor":"x.com","reason":"Bring your X session into pup so I can use X for you"}'
adom-bridge --ai-thread "<your thread>" pup_navigate '{"url":"https://x.com/home"}'

The user approves one Adom Bridge consent and one Windows prompt. pup brings over the x.com cookies, sets them in its own browser, and never prints them. The page opens signed in. This needs pup 2.0.735 or later, on Windows.

If the answer is several_sessions, the user's browser has more than one X account signed in. Ask the user which account they mean, then call again with sourceProfile set to one of the listed names. If the answer is no_session, the user's own browser isn't signed in to X either: ask them to sign in there once, then try again.

Why the normal sign-in does not work (measured 2026-10-27, pup-bridge#136)

The whole "Continue with Google" flow runs in pup in the background, with no real mouse, and X still says no:

  1. Click X's own button. Click the visible "Continue with Google" button, which is X's own element: pup_click {text:"Continue with Google"}. Don't click the coordinates of Google's accounts.google.com/gsi/button frame. That frame sits just below the visible button, and clicks there do nothing.
  2. Drive the popup in pup. Google's account picker opens as a popup, and pup adopts it as <window>-2 within a couple of seconds (pup_my_windows). Drive it with pup_click {window:"<window>-2", text:"<email>"}.
  3. X refuses. X answers "An unexpected error occurred. Please try again." It does this even with a clean background flow and a valid Google account. That is X refusing a new sign-in from this browser, not a pup click problem.

Never fall back to the real mouse (desktop_click) for this site. It doesn't get past X's check either, and it takes over the user's screen.

Rules

  • pup_google_signin is for Google's own sign-in pages. Don't call it while another site's Google popup is open: it navigates the original window away.
  • The session belongs to the user's account. Use it only for what the user asked.