Fallback login callback port when default is busy#19334
Merged
Conversation
0388521 to
19f5a72
Compare
alexsong-oai
approved these changes
Apr 29, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
1455first./cancelrecovery for stale Codex login servers.1457when1455remains 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 inopenai/openai#863817. This keeps the OAuthredirect_uriinside Hydra's exact allow-list instead of choosing an arbitrary ephemeral port.Validation
just fmtcargo test -p codex-logingit diff --check HEAD~1..HEAD