Harden run-electron port preflight on Windows#186
Closed
UnlikelyKiller wants to merge 1 commit into
Closed
Conversation
Owner
|
Thanks @UnlikelyKiller for this PR and for calling out the unsafe Windows port preflight behavior. PR #209 addressed the same underlying issue as part of the configurable Agent API port work: startup now checks the configured API port cross-platform, only cleans up prior Tandem/Electron listeners when they are safe to identify, and fails clearly instead of blindly killing unrelated processes. I did not merge this PR directly because the active startup path moved into |
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.
This tightens
scripts/run-electron.jsso local startup behaves more safely on Windows and more predictably across platforms.What changed
lsofcleanup path with a cross-platform port-8765 preflightnetstat -ano -p tcpand resolve executables via PowerShell/CIM8765, and print the PID/executable insteadps -o comm=returns a shortened command nameWhy
On Windows 11, the old script assumed
/usr/sbin/lsofand unconditional kill behavior that does not exist or is unsafe there. During local validation, this also helped make conflicts with other listeners on8765visible instead of silently starting into a bad state.Verification
node -c scripts/run-electron.js8765