Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
-
Connect a T3 Code client, and start an agent thread.
-
From that agent, run two local servers for 9 seconds:
timeout 9 python3 -m http.server 0 --bind 127.0.0.1 > with.log 2>&1 & env -u T3CODE_THREAD_ID timeout 9 python3 -m http.server 0 --bind 127.0.0.1 > without.log 2>&1 &
-
Read the two logs.
Expected behavior
A user can turn the discovery of local servers off, or at least its probing. A test process that an agent starts gets no request that it did not ask for.
Any of these solves it. The first is the most useful:
- A setting in
settings.jsonand an environment variable (for exampleT3CODE_DISCOVER_LOCAL_SERVERS=false) that turns off the scan. - Probe only when the preview panel is open, not whenever a client is subscribed.
- Probe only a listener that has lived for some time, for example 30 seconds, so short test listeners stay untouched.
- Let a process opt out through an environment variable.
Actual behavior
with.log shows GET / HTTP/1.1 from 127.0.0.1, and without.log shows none. No setting turns this off.
While a client subscribes to subscribeDiscoveredLocalServers, PortDiscovery scans every 3 seconds. It finds each listener that a process with T3CODE_THREAD_ID in its environment owns, or that belongs to a T3 terminal, and sends GET / to it. We also saw a TLS client hello on such ports. A test process inherits the variable from the agent, so its short-lived fake servers count as servers to find.
Test fakes often count requests, or refuse a request they do not expect. The probe arrives about 2 seconds after the listener opens, so the result depends on timing. In Go test suites we saw:
the proxy got 2 connections, want none- A fake server failed the test because it got a
GET /it does not answer. - A fake server recorded an unsigned call that no test code made.
One test failed in 5 of 20 runs and another in 1 of 20 on an unchanged commit. The failures looked like load-related flakes, and finding the real cause took a long time. A server under development also sees a request that nobody made.
Impact
Minor bug or occasional failure
Version or commit
t3 v0.1.5
Environment
Linux, t3 serve, Claude Code as the agent provider, a T3 Code client connected
Logs or stack traces
127.0.0.1 - - [04/Nov/2026 08:01:45] "GET / HTTP/1.1" 200 -Workaround
Unset T3CODE_THREAD_ID before a test run. This works, but every test command of an agent needs it, and an agent does not know it has to.
Activity
[-]Allow the discovery of local servers to be turned off: its probes break test suites that an agent runs[/-][+][Bug]: The discovery of local servers probes test listeners and cannot be turned off[/+]juliusmarminge commentedon Nov 4, 2026
Thanks for the detailed report. Your version, 0.1.5, behaves as described: it sent
http://andhttps://requests to every listener owned by an agent or a terminal. That is theGET /and the TLS client hello you saw.bf8e132 (#27893) fixed this, and the fix shipped in v0.1.6. Discovery now reads which process holds each port and never connects to it. The only addresses it requests are the Preview URLs that you configure on project scripts. The same change added
T3CODE_PORT_DISCOVERY=0, which turns off listener discovery. Set it in the environment that starts the T3 Code server, for example inservice.envfor the background service.What I ran on current
main(8b44f42), Linux, with a fresh database and the Browser panel open so a client was subscribed to discovery:with.logandwithout.logwere both empty, so neither server got a request.timeout 40andpython3 -u: the panel listedpython3 localhost:<port>for the server that inheritedT3CODE_THREAD_ID. It did not list the one that ran withenv -u. Over its 40 seconds (about 13 scan cycles), neither log showed a request.timeout 30 python3 -u -m http.server 0 --bind 127.0.0.1): the panel listed it, and its log shows no request.Closing this as fixed. Please reopen if you still see probes on 0.1.6 or later.
pr0ton11 commentedon Nov 4, 2026
Thanks Julius
Great work on T3Code, it's awesome