Skip to content

feat(web): show servers running in a thread workspace - #39

Open
gstark wants to merge 7 commits into
upstream-base/v0.1.3from
pr/workspace-servers
Open

gstark wants to merge 7 commits into
upstream-base/v0.1.3from
pr/workspace-servers

Conversation

@gstark

@gstark gstark commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Agents often start dev servers, databases, and other listeners in a thread's workspace. T3 Code did not show them, so you had to find the port and an address that works from your device yourself.

The thread details panel now has a collapsible "Servers" section. It lists each process that listens on a port and runs in the thread's workspace, with links or copyable addresses. The section stays hidden until the workspace has a server.

  • A new server.getWorkspaceServers RPC takes a thread ID and needs orchestration read scope. The server resolves the directory from the thread's worktree or project root. It never accepts a path from the client, because any directory could list every server on the host.
  • WorkspaceServers reads listeners with lsof on macOS, and with ss and /proc on Linux. A process belongs to the thread when its working directory is inside the workspace, or when it runs in one of the thread's T3 terminals. Windows returns supported: false.
  • The server guesses the kind (HTTP, Postgres, MySQL, Redis, MongoDB, S3, or TCP) from the process name and port, because a probe can crash a binary protocol server. Only a guessed HTTP server gets one GET /. That request reads the page title, follows same-port redirects, and falls back to HTTPS when the server drops plain HTTP.
  • Each server gets loopback, LAN, and tailnet addresses (MagicDNS name included) from its bind addresses. The client shows only the addresses it can reach over its connection. A local desktop sees all of them, a LAN or tailnet connection sees its own network, and a T3 Connect relay sees none. For an SSH connection, the client uses the SSH host name.
  • Browsers can open HTTP, HTTPS, and S3 addresses. Database and TCP addresses copy to the clipboard.
  • The client polls every 5 seconds while the section shows. The server shares one host scan between clients for 2 seconds, caches network addresses for 30 seconds, and caches page titles for 10 minutes (15 seconds when no page answered).

Kept in sync from mine by fork-prs.

- Show reachable server addresses and service types in thread details
- Detect listeners from workspace processes and T3 terminals
Use the saved SSH host name to identify which discovered server addresses this device can reach.
- Probe guessed HTTP servers for page titles and HTTPS support
- Show HTTP and HTTPS icons with the title and process name
- Derive the workspace from the thread on the server instead of trusting a client path
- Handle malformed redirects safely
@gstark gstark added the needs-evidence The UI diff changed; add new captures label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-evidence The UI diff changed; add new captures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant