Repository navigation
fix(server): improve remote port fallback handling - #3
Merged
Merged
Conversation
Check EADDRINUSE via error codes so remote port fallback still advances when Bun omits the code from the message. Keep the retry logic aligned across Bun and Pi runtimes with regression coverage for Bun-style errors.
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.
Summary
19432-19439) instead of failing immediately on the first occupied porterr.code === "EADDRINUSE"while keeping the Pi runtime aligned with the same retry behaviorWhat this does
19432is already occupied by trying the next port in the default rangePLANNOTATOR_PORTstill preserves exact-port behaviorWhat this does not solve
PermissionRequest/ExitPlanModesuccess path does not offer a clean user-visible channel for a customPlannotator is ready at http://...messageRelated workaround
session.prompt()rather than a proper status/tool UI surface, so it comes with tradeoffs like queued delivery and session noiseWhy this stays fork-only for now
This improves backend robustness, but the UX is still incomplete until the chosen port can be surfaced cleanly across integrations. Because of that, I’m treating this as a reference implementation rather than something I’d upstream as-is.
Testing
bun test packages/server/remote.test.ts apps/pi-extension/server/network.test.ts