Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): only show browser-ready local servers #6021

Mergedchrisdeeming(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/6021/headmerged by maria-rcks View on GitHub

What Changed

Filter discovered localhost listeners through bounded HTTP and HTTPS probes before publishing them to the Browser panel. Local servers now includes successful HTML or XHTML responses and redirects, while excluding HTTP errors, non-document responses, and raw TCP services.

Configured URLs only enrich matching live results, while browser history remains in Recently used. This also removes the always-green status indicator.

Why

Port discovery previously treated any listening socket as a potential browser target. This produced noisy lists containing services such as MySQL and Redis, alongside HTTP servers whose root routes returned errors or non-viewable content.

The scanner is now authoritative and briefly caches positive and negative probe results to avoid unnecessary repeated requests without leaving stale classifications around.

UI Changes

BeforeAfter
imageimage

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented and independently reviewed with GPT-5.6-Sol using the Codex harness in T3 Code.


Note

Medium Risk Touches core preview discovery and the discovery RPC contract, including new outbound HTTP probes against local listeners. Behavior and caching bugs could hide valid servers or keep probing stale configured paths.

Overview Only browser-ready localhost servers are published after bounded HTTP/HTTPS probes. Listening sockets must return a successful HTML/XHTML document or a navigation redirect; non-HTTP services, errors, and non-document responses are excluded. Probe results are cached for 15s with concurrency and timeout limits.

Configured URLs are now probed on the server. Clients pass them through subscribeDiscoveredLocalServers, and each subscriber gets a projected live snapshot. Non-live configured and recently-seen entries are dropped from the local-servers list; history stays under Recently used. Listening-status dots are removed from server cards.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7de1c4eca05a277ddaf5df5f1e12df0630fe03ff. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Filter discovered local servers to browser-ready HTTP(S) servers only

  • The PortDiscovery service now probes discovered ports via HTTP(S) to classify only browser-ready servers, filtering out non-HTTP listeners before surfacing them in the preview UI.
  • Clients send bounded configured URL candidates (configuredUrls) to the server via the subscribeDiscoveredLocalServers RPC; the server returns a configuredUrlProbing flag indicating whether path-aware probing was performed.
  • Loopback host aliases are deduplicated in mergeServers, and configured URLs are only shown when the live scanner confirms the server is active.
  • Probe results are cached per URL and process identity with a bounded concurrency semaphore to limit parallel HTTP probes.
  • Behavioral Change: The preview UI no longer shows recently-seen or non-live configured URL entries; only servers confirmed live by the scanner and HTTP probe are displayed.
Macroscope summarized 7de1c4e.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 177566ed-53c6-4a88-94d9-402caac3761e

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR significantly changes runtime behavior by adding HTTP content-type validation before showing servers in the preview list. Servers that don't respond with browser-ready HTML will no longer appear. This introduces new probing infrastructure with caching, timeouts, and redirect handling - a substantial feature change warranting human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2c50f25711cee449e94cbbbc4c722bdea59c0fdb. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. t3-code-bot[bot](GitHub profile, opens in a new tab) approved these changes

      final review at 7de1c4ec. browser-ready response policy, bounded probes, cache invalidation, configured-path projection, loopback canonicalization, and subscriber isolation look correct. focused lint, typechecks, 57 targeted tests, and diff check pass.

    6. maria-rcks merged this9fd788b

    7. maria-rcks closed this

Sign in to join this conversation.