Repository navigation
fix(server): do not HTTP-probe unknown local listeners - #9832
lnieuwenhuis wants to merge 2 commits into
Conversation
PortDiscovery no longer sends HTTP(S) probes to every discovered TCP listener. A discovered listener is probed only on a curated dev port or when owned by a registered T3 terminal; configured Preview URLs are probed as before. This avoids writing HTTP onto unrelated binary/RPC listeners. Related pingdotgg#8407 (not closing: a curated/terminal binary can still hit the ~10s TLS-abort stall, socket-cleanup/abort follow-up remains open).
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server bug fix that stops probing unrelated local listeners while preserving curated-port, terminal-owned, and explicitly configured preview behavior. The production logic is localized and accompanied by targeted tests for both skipped and retained listeners. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe preview port scanner now filters discovered listeners before HTTP probing. It probes curated development ports and listeners owned by registered T3 terminals, while tests verify both exclusion and inclusion cases. ChangesPreview port eligibility
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Discovered unrelated listeners are no longer sent HTTP probes, while curated ports, registered-terminal listeners, and configured preview URLs retain intended behavior. The change has focused coverage and is ready to merge. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Another real-world case for this one. On Windows, pCloud Drive listens on 127.0.0.1:19191 as its single-instance channel. When the preview panel scans, T3 Code sends Confirmed on current Nightly (Windows 11) by matching the trace ID in This PR fixes it, since 19191 isn't a curated dev port and pCloud isn't a T3 terminal process. Would be great to see it merged. |
|
Note Grok responding on behalf of Julius. Thanks for this! #16687 just landed on main and covers the same ground: discovery now only probes listeners owned by T3 terminals and skips ports with any unowned listener, which is stricter than the curated-ports approach here. Closing this one as superseded. |
Every discovered local listener gets HTTP-probed, including foreign processes that stall the probe for seconds.
Only probe discovered listeners on curated dev ports or ones owned by a known terminal; configured preview URLs are unchanged.
Ports #8561 as blast-radius reduction. Related to #8407 (not closing it): curated or terminal-owned listeners can still hit the underlying TLS-abort stall, which needs the socket-cleanup follow-up.
Built with muse-spark-1.3-contributor via OpenCode in T3 Code.
Note
Medium Risk
Changes which local listeners get HTTP probes during preview scans; dev servers on non-curated ports may only appear if the user configures a URL or the terminal PID is registered.
Overview
Port discovery no longer sends HTTP(S) probes to every socket
lsof(or Windows listener enumeration) finds. Discovered listeners are only probed when the port is inCOMMON_DEV_PORTSor the owning PID is tied to a registered T3 terminal (server.terminal); other listeners are skipped so non-HTTP services are not hit with web requests or long probe timeouts.Configured preview URLs are unchanged—they still go through the existing configured-URL probe path regardless of port. Tests cover skipping a high port with no terminal registration and probing that same port after
registerTerminalProcesses.Reviewed by Cursor Bugbot for commit 4ab29b7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Stop HTTP-probing unknown local listeners in
PortDiscoveryDiscovered listeners from
lsofare now only probed when their port is inCOMMON_DEV_PORTSor they are associated with a registered T3 terminal. Other sockets are skipped entirely, avoiding HTTP requests to foreign or unrelated listeners.isEligibleDiscoveredWebProbepredicate in PortScanner.ts and applies it in the scan candidate grouping loopPortDiscovery.scanno longer HTTP-probes or publisheslsof-discovered listeners outsideCOMMON_DEV_PORTSwith no terminal associationMacroscope summarized 4ab29b7.
Summary by CodeRabbit