From 45774f76a10c824ac4fa9120a86bb9040520a062 Mon Sep 17 00:00:00 2001 From: nullStack65 <112618179+nullStack65@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:52:16 +0000 Subject: [PATCH] fix(web): browser tests no longer proxy to the T3 server running the agent The web Vite config proxies /api, /ws and /.well-known to localhost:$T3CODE_PORT, and the browser test projects inherit that server config. Agents running inside T3 inherit T3CODE_PORT from the live server, so browser tests discovered the real primary environment instead of the fake one. Sidebar.shortcuts' "leaves thread shortcuts ... to the preview" failed every time that way: the sidebar keyed threads under the live environment's ID, the route used the fixture's, and Ctrl+Shift+] had no current thread to move from. Under Vitest the proxy is now off. Co-Authored-By: Claude Opus 5.5 --- apps/web/vite.config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 83847db8c00a..1a55244ddc9a 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -212,7 +212,10 @@ function resolveDevProxyTarget( } } -const devProxyTarget = resolveDevProxyTarget(process.env.T3CODE_PORT, configuredWsUrl); +// Agents inside T3 inherit T3CODE_PORT; browser tests must not reach that live server through the proxy. +const devProxyTarget = process.env.VITEST + ? undefined + : resolveDevProxyTarget(process.env.T3CODE_PORT, configuredWsUrl); // Brotli quality 5 encodes in hundreds of ms; default quality 11 would replace transfer stalls with encode stalls. function devCompressionPlugin(): Plugin {