# Pi dev-server discovery: real-app driver

Surface: Linux web, Chromium, 1280 x 800, light theme. Two isolated dev stacks, one at each supplied commit. Fresh databases were initially created with T3CODE_DEV_SEED=0; no live data was copied. Pi was the only configured provider instance. Model: anthropic/claude-haiku-5-5.

## Setup used on each side

1. Install dependencies with `vp i`.
2. Start with `env -u T3CODE_THREAD_ID T3CODE_DEV_SEED=0 vp run dev`. Unsetting this variable is essential when the evidence agent itself runs inside T3: inherited tags on Vite/server listeners otherwise keep discovery active and hide the defect.
3. Set this worktree's userdata/settings.json providerInstances to:
   `{"pi":{"driver":"pi","displayName":"Pi","config":{"enabled":true,"binaryPath":"pi"}}}`.
   Settings are watched and normalized by the app. No database writes.
4. Add one synthetic project with the app's `project add <workspace> --title 'Pi server discovery' --base-dir .t3` CLI.
5. Start a Pi thread using `thread start --base-dir .t3 --provider pi --model anthropic/claude-haiku-5-5 --title 'Pi server proof' <workspace> 'Wait for my next message.'`.
6. Pair the browser using the stack's one-time link and open `/<environment-id>/<url-encoded-thread-id>` directly. Keep Thread details visible. Hide only the Environment and worktree row using its supported visibility setting, to keep machine identity private. Servers remains enabled.
7. Confirm no TCP listener carries T3CODE_THREAD_ID before beginning the final base run. No terminal or preview URL is configured.

## Same browser interaction on each side

Through T3's preview browser tools:

- `preview_recording_start`.
- `preview_act` type into `[role="textbox"][contenteditable="true"]`:
  `Start a local dev server for me: run nohup python3 -m http.server 8799 --bind 127.0.0.1 >/tmp/pi-repro.log 2>&1 & in the background, then reply with only its PID.`
- `preview_act` press Enter.
- Keep the page open without reloading for at least 110 seconds after submission.
- Run `listener-control.py --thread <thread-id>` to verify the listener is python3 and carries that exact owning thread's T3CODE_THREAD_ID.
- Capture Thread details. Take two screenshots at least 500 ms apart and compare pixels before choosing the still.
- Reload the same thread page; observe Thread details again, capture, then stop recording.
- Stop only the Python PID returned by this Pi turn before running the other side.

An initial discarded attempt inherited the evidence thread tag on both dev stacks; base discovery then worked. Both stacks were stopped and restarted untagged, and new proof threads were created for the final comparison. No code was modified.

## Delegated Pi child variant

After stopping the main-thread Python listener, send the same instruction to each Pi parent:

> Create one T3 delegated subagent with the Pi provider and anthropic/claude-haiku-5-5 model in the shared workspace. Call orchestrator_capabilities first, then delegate_task. Title it Pi child server proof. Its task is only: Wait for my next message; do not start any server yet. Use mode async. Reply only with the child thread id and link. Do not use a native pi-subagents extension.

Open each returned child thread directly. The client shows "Subagent of · Pi server proof" and Lineage. The initial base child returned a PID but had no listener by the post-turn control, so that attempt is not discovery evidence. For the matched child comparison, submit this same adjusted prompt on both sides:

> Start a local dev server: run nohup python3 -m http.server 8799 --bind 127.0.0.1 >/tmp/pi-repro.log 2>&1 & and capture its PID. Keep this child turn alive by running sleep 150 (with a timeout of at least 160 seconds) before replying with only that PID. Do not stop the server.

Record from submission through more than 110 seconds. Run listener-control.py while the turn is alive, and inspect Thread details without reloading. Stop the base listener before launching the head listener. The recording intentionally shows an active agent turn, because discovery is being observed while that child owns a live server. This verifies T3 delegated Pi child threads while running; it does not verify a server surviving child completion, nor the third-party native pi-subagents extension. No still is used for this variant because the working timer changes continuously.
