# Stalled preview link reproduction

Both runs use the real web client, Node server and server-owned Chromium browser, started from separate detached worktrees. The only source difference is the PR fix. No application source was changed for proof.

- Before: [84cb0f411a](https://github.com/pingdotgg/t3code/commit/84cb0f411a33906df112c3697f9052460ab30d9d) (merge-base of origin/main and the PR head).
- After: [a9d7614a39](https://github.com/pingdotgg/t3code/commit/a9d7614a3999f0675c6d85405f5843be239cf9e0).
- Linux, Chromium Browser panel; 1280 × 800 CSS viewport; light app theme; maximized Browser surface.
- Fresh database per checkout, started with `T3CODE_DEV_SEED=0 vp run dev`.
- Synthetic project added with the app CLI, then one thread using `--provider devReplay --model multi-turn --wait --json`.

## Driver

`proxy.mjs` takes five arguments: checkout root, Vite web port, proxy port, before/after label, and a new output directory. It resolves the checkout's existing `ws` package. It forwards HTTP and WebSockets without fabricating server messages. Only `/api/preview-stream/ws` is shaped. Each nonempty binary message is an actual JPEG image from the app; an empty binary message is a latency probe. A FIFO matches actual client acknowledgements to messages. JSONL logs have relative timestamps and no credentials or URLs.

1. Run `node proxy.mjs <checkout> <web-port> <proxy-port> <before-or-after> <new-output-directory>`.
2. Open the app's printed pairing URL through the proxy port. Use separate browser profiles for the two environments.
3. Open the seeded thread by its direct URL. Hide the sidebar and thread details, open a Browser surface, and maximize it.
4. In that Browser surface, navigate to `http://localhost:<proxy-port>/fixture`. This synthetic canvas animation is served by the driver, rendered by the real server-owned Chromium, encoded by the app and displayed by the real web client.
5. In the OUTER app page, inject the transport display: `let s=document.createElement('script'); s.src='/evidence-overlay.js'; document.body.append(s)`. This overlay is explicitly labeled transport instrumentation; it reads the proxy's real counters and does not alter application behavior.
6. Start a Browser panel recording. Schedule `setTimeout(()=>fetch('/evidence-arm'),5000)` in the outer app page.
7. The proxy initially adds 40 ms propagation each way (80 ms RTT), and serializes images at 2 ms each. After arming, the next image bringing the outstanding count to at least three triggers a three-second freeze in both directions. Already scheduled deliveries are held too. After the freeze, propagation is 1150 ms each way (2300 ms RTT), and images serialize at 500 ms each. Control messages and empty probes have no image serialization charge. The stall happens once, with no reconnect or queue reset.
8. Continue recording for at least 34 seconds after the degradation. Observe outstanding images and probe count, plus continuing source animation updates. Stop recording.

Expected fixed behavior: initial outstanding images drain, then only one image is sent per approximately 2.8-second cycle, with an empty probe on each idle cycle. Broken behavior: returning stale image acknowledgements refill a window of six images indefinitely, with no idle probe.

The videos include the fast phase, stall and degraded phase. PNG posters are frames extracted from those recordings, not claims that a moving animation is a static screen. `transport.jsonl` files provide the corresponding actual wire timings. No unit tests were used as evidence.
