Skip to content

Fallback login callback port when default is busy#19334

Merged
xli-oai merged 3 commits intomainfrom
xli-codex/login-port-fallback
Apr 29, 2026
Merged

Fallback login callback port when default is busy#19334
xli-oai merged 3 commits intomainfrom
xli-codex/login-port-fallback

Conversation

@xli-oai
Copy link
Copy Markdown
Contributor

@xli-oai xli-oai commented Apr 24, 2026

Summary

  • Keep the preferred ChatGPT login callback port 1455 first.
  • Preserve the existing /cancel recovery for stale Codex login servers.
  • Fall back to the registered localhost callback port 1457 when 1455 remains unavailable.

Why

Cursor and Codex Desktop both use the ChatGPT account login callback server. On Windows, Cursor can already be listening on 127.0.0.1:1455 / [::1]:1455, causing Codex Desktop sign-in to fail with:

Local callback port 1455 is already in use on this machine.

Codex already attempted to cancel a stale Codex login server on that port, but if the listener does not release the port, the old behavior was to fail. The new behavior falls back to 1457, which matches the fixed redirect URI being registered server-side in openai/openai#863817. This keeps the OAuth redirect_uri inside Hydra's exact allow-list instead of choosing an arbitrary ephemeral port.

Validation

  • just fmt
  • cargo test -p codex-login
  • git diff --check HEAD~1..HEAD

@xli-oai xli-oai added the oai PRs contributed by OpenAI employees label Apr 24, 2026
@xli-oai xli-oai closed this Apr 24, 2026
@xli-oai xli-oai reopened this Apr 27, 2026
xli-oai added a commit that referenced this pull request Apr 27, 2026
@xli-oai xli-oai force-pushed the xli-codex/login-port-fallback branch from 0388521 to 19f5a72 Compare April 28, 2026 00:38
@xli-oai xli-oai merged commit 8d5da3f into main Apr 29, 2026
25 checks passed
@xli-oai xli-oai deleted the xli-codex/login-port-fallback branch April 29, 2026 21:45
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants