From d3729ed6c35a9bb1ea99d066346561666a7b4605 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 17:24:42 +0000 Subject: [PATCH 1/2] test(server): a server without the desktop browser channel marks its tabs headless Fails on main: in WSL-only mode the desktop starts its backend without browser fds, the server never marks its tabs headless, and the desktop draws a local page the address bar cannot navigate (#17009). AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/preview/ServerBrowser.test.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/server/src/preview/ServerBrowser.test.ts b/apps/server/src/preview/ServerBrowser.test.ts index a86dcc415c109..e1085b199a829 100644 --- a/apps/server/src/preview/ServerBrowser.test.ts +++ b/apps/server/src/preview/ServerBrowser.test.ts @@ -742,6 +742,26 @@ it.effect("a tab the desktop does not draw is marked headless, so the desktop st ).pipe(Effect.provide(layer)), ); +it.effect("a server started without the desktop browser channel marks its tabs headless", () => + Effect.scoped( + Effect.gen(function* () { + const { tabId } = yield* ready; + const manager = yield* Manager.PreviewManager; + const { sessions } = yield* manager.list({ threadId: scope.thread.threadId }); + + expect(sessions.find((session) => session.tabId === tabId)?.headless).toBe(true); + }), + ).pipe( + // A WSL-only desktop starts its backend without the browser fds. + Effect.provide( + ServerBrowser.layer.pipe( + Layer.provide(DesktopChannel.layer), + Layer.provideMerge(dependencies), + ), + ), + ), +); + it.effect("an agent's tab the reloaded desktop dropped goes back to the desktop", () => Effect.scoped( Effect.gen(function* () { From b51b3613d2ee1d121b50be12d3d20d4c646b622f Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 12 Nov 2026 17:30:25 +0000 Subject: [PATCH 2/2] fix(preview): Browser pane navigates when the desktop backend has no browser channel In WSL-only mode the desktop starts its backend without the desktop browser fds, so the server never marked its tabs headless. The desktop then drew its own local page that typed URLs never reached, while agents drove a separate headless page. Mark every tab the desktop does not draw headless, so the pane streams the server's page. Fixes pingdotgg/t3code#17009 AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/preview/ServerBrowser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/preview/ServerBrowser.ts b/apps/server/src/preview/ServerBrowser.ts index ecb3184b09979..53d2a01e6f30e 100644 --- a/apps/server/src/preview/ServerBrowser.ts +++ b/apps/server/src/preview/ServerBrowser.ts @@ -887,8 +887,8 @@ const make = Effect.gen(function* () { if (desktop) opened.push(desktop.close); // Attaching over CDP emulates a light scheme; a tab on System follows the desktop's. if (desktop) await desktop.page.emulateMedia({ colorScheme: null }); - // Otherwise a desktop that attaches late shows its own page, and the agent drives another. - if (!desktop && desktopChannel.available) { + // Otherwise a desktop that attaches late, or has no channel to draw it, shows its own page. + if (!desktop) { await runPromise( manager .markHeadless({ threadId: ThreadId.make(snapshot.threadId), tabId: snapshot.tabId })