Skip to content

Browser local servers: hide unwanted entries and discover project systemd/cwd listeners #9

Closed

Description

@tannerpolley

Problem

The browser panel's Local servers list shows servers I don't need, and misses ones I do.

  • Noise: each agent session starts its own Serena dashboard. On 2026-10-05 this machine had 23 Serena listeners (127.0.0.1:24282–24304). Agents started them inside T3 sessions, so they count as T3-owned and pass the HTML probe, and they crowd the list.
  • Missing: a long-running user systemd service on a port outside the fixed list never appears. The concrete case is the Amine-Thermodynamics analyses preview: cse-preview-Amine-Thermodynamics-daf39727.service, serving 127.0.0.1:8770 with working directory …/Engineering/Amine-Thermodynamics/analyses, inside the project root. It is the most useful server for that project, yet I had to add a dummy project script with previewUrl just to make it show up.

Current behaviour

apps/server/src/preview/PortScanner.ts (at 31a0fb3a42) probes only:

  1. T3-owned listeners, meaning terminal and process descendants;
  2. COMMON_DEV_PORTS (3000, 3001, 3333, 4173, 4200, 4321, 5000, 5173–5175, 5500, 8000, 8080, 8081, 8888, 9000);
  3. configured URLs, which come only from project scripts' previewUrl (getConfiguredPreviewUrls in apps/web/src/components/preview/previewEmptyStateLogic.ts).

There's no way to hide an entry, and no discovery of listeners outside these three sources.

Wanted

  1. Hide unwanted servers, persistently. Hide one entry from the list, plus a rule that covers a whole family, for example by process name (serena) or by port range. Hidden entries are restorable from settings and don't come back on each scan.
  2. Find project-relevant servers that T3 didn't start. The lsof output already gives each listener's process ID. Also consider loopback listeners whose process either runs in a user systemd unit (/proc/<pid>/cgroup → …/app.slice/<unit>.service) or has a working directory (/proc/<pid>/cwd) inside a registered project's workspace root. These still pass through the existing bounded HTML probe and its cache.
  3. Show why each server is listed, and rank by relevance. Label each entry with its source (T3-started, project directory, systemd unit name, common port, configured), and list the active project's servers first.

Acceptance examples (this machine)

  • With a serena hide rule, none of the 23 Serena dashboards appear. Removing the rule brings them back.
  • In the Amine-Thermodynamics project, 127.0.0.1:8770 appears without any project script, labelled with its unit cse-preview-Amine-Thermodynamics-daf39727.service, ahead of unrelated servers.
  • Non-HTML listeners such as Zotero's local ports and Steam still don't appear. The HTML probe stays the gate.

Not requested

No scanning of non-loopback interfaces. No change to the probe timeout or cache rules. No killing or restarting services from the list.

Activity

  1. tannerpolley commented on Oct 6, 2026

    @tannerpolley
    OwnerAuthor

    Queued 2026-10-05 in milestone 05 - Browser and preview. Work starts on the current fork (sync/upstream-v2, v2.9.x), whose PortScanner.ts already includes Batch 2c's preview fixes. This touches the server (discovery) and the interface (hide rules, labels), so it ships with a server restart.

  2. tannerpolley commented on Oct 6, 2026

    @tannerpolley
    OwnerAuthor

    Merged into sync/upstream-v2, ships in fork build v2.9.3 (staged; needs a server restart).

    • Discovery covers project-directory and systemd listeners, and each entry says why it is listed. Projects reached through symlinks are attributed correctly.
    • Hide rules are an environment setting (localServerHideRules). The scanner applies them before probing, so hidden servers get no HTTP requests. Restore them in Settings.
    • Tests cover hide, rescan and restore against the real settings service.

    Not yet tried in a real client.

  3. tannerpolley commented on Oct 14, 2026

    @tannerpolley
    OwnerAuthor

    Done and installed (v2.11.1, running since 2026-10-13 17:43):

    • Local servers is scoped to the active project, including servers running in that project's worktrees and in new-thread drafts. Checked in the sandbox with the machine's real servers: the Amine and Lithium previews each show only in their own project.
    • The owner's hide rules are now set through the new agent tool: serena (process), port 3773 (T3 itself) and syncthing (process). Agents add or remove single rules against the current list, so rules set in Settings are never lost.
    • Hide and restore, the source labels and systemd/project discovery were already in place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions