Skip to content

fix(web): signing in from Settings opens one sign-in page - #578

Merged
badcuban merged 1 commit into
mainfrom
fix/codex-login-localhost
Oct 22, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/codex-login-localhost

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Signing in to Codex from Settings opened the OpenAI page and also http://localhost:1455/. Checking the other providers found the same kind of bug: Claude (sign-in and token setup), Cursor, OpenCode and Pi open their sign-in page themselves, so Settings opened a second copy. In Pi's "Open it here" terminal sign-in that copy was cut off and didn't load.

Why. For terminal sign-ins the Settings panel opens the first address the login command prints. codex login prints its local callback server before the OpenAI address. On Windows the terminal draws blank lines as cursor jumps, which glued the next words onto the address (...codex_cli_rsOn). Pi's screen wraps long addresses into 98-column rows.

How it's fixed (providerConnectFlow.logic.ts, providerAuthCommands.ts, ProviderInstanceCard.tsx, ProviderConnectFlow.tsx):

  • The panel never takes an address on the CLI's own machine (localhost, 127.0.0.0/8, 0.0.0.0, *.localhost) or one that doesn't parse.
  • A cursor jump to another row reads as a line break.
  • An OSC 8 link's full target is read first, so a wrapped link gives its whole address. The output kept between chunks never cuts a code in half.
  • SELF_OPENING_SIGN_IN_DRIVERS lists Codex, Claude, Cursor, OpenCode and Pi. For them Settings shows "Open sign-in page" instead of opening the page again. The tool still opens the page itself, as before.

Checked.

  • vp fmt, vp lint and vp run typecheck pass.
  • New unit tests replay Codex's Windows output, Pi's wrapped rows split across chunks, a 2,400-character link split mid-code, and local addresses. Each fails without its fix.
  • A Settings browser test checks that Claude's printed address is opened once, by the click.
  • A throwaway script split each sample at every point, plus 3,000 random three-way splits per sample, and the exact address was picked every time.
  • What each CLI prints and whether it opens the browser came from reading its published source or binary. No real logins were run.
  • Reviewed twice by GPT-6.1-Sol. Its findings are fixed: Cursor opening nothing from the setup screen or chat, a code cut at the kept-output edge, 127.0.0.2 and [::1] getting through, and a waiting address dropped by the tail cut.

Known, not changed here.

  • Grok still opens its page twice. This is documented in docs/providers/grok.md.
  • Only the Settings panel opens printed addresses. The setup screen and the chat don't, so an fx sign-in started there (fx in WSL can't open a browser) opens nothing. That's an existing gap.
  • Pi's link can point at a "What's New" or usage link if one shows before /login.

Signing in to Codex from Settings opened the OpenAI page and also
http://localhost:1455/. The panel opens the first address a login command
prints, and `codex login` prints its local callback server first. Claude,
Cursor, OpenCode and Pi open their sign-in page themselves, so Settings
opened a second copy for them. In Pi's terminal sign-in the copy was cut off,
because Pi wraps long addresses into 98-column rows.

- The panel never takes an address on the CLI's own machine (localhost,
  127.0.0.0/8, 0.0.0.0, *.localhost) or one that doesn't parse.
- A cursor jump to another row reads as a line break. Windows terminals draw
  blank lines that way, which glued the next words onto the address.
- The full target of an OSC 8 link is read first, so a wrapped link gives
  its whole address. The kept output never cuts a code in half across chunks.
- Codex, Claude (sign-in and token setup), Cursor, OpenCode and Pi are listed
  in SELF_OPENING_SIGN_IN_DRIVERS. For them Settings shows "Open sign-in
  page" instead of opening the page again.
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Oct 22, 2026 6:39pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit 5baa004 Oct 22, 2026
20 checks passed
@badcuban
badcuban deleted the fix/codex-login-localhost branch October 22, 2026 18:51

This branch was previously deployed

1 inactive deployment
Preview — cc26325c Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant