@devries-cameron20 / t3code Mirror · read-only / commits / 4c255bc9c3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 19:45 UTC

fix(preview): Browser pane navigates when the desktop backend has no browser channel (#35424)

Julius Marminge committed Nov 12, 2026 at 10:59 UTC 4c255bc9c3fa45eddc2efa7394967c3a36a89946
2 files changed +22 -2
apps/server/src/preview/ServerBrowser.test.ts
+20
@@ -742,6 +742,26 @@ it.effect("a tab the desktop does not draw is marked headless, so the desktop st
742 ).pipe(Effect.provide(layer)),
743 );
744
745 +it.effect("a server started without the desktop browser channel marks its tabs headless", () =>
746 + Effect.scoped(
747 + Effect.gen(function* () {
748 + const { tabId } = yield* ready;
749 + const manager = yield* Manager.PreviewManager;
750 + const { sessions } = yield* manager.list({ threadId: scope.thread.threadId });
751 +
752 + expect(sessions.find((session) => session.tabId === tabId)?.headless).toBe(true);
753 + }),
754 + ).pipe(
755 + // A WSL-only desktop starts its backend without the browser fds.
756 + Effect.provide(
757 + ServerBrowser.layer.pipe(
758 + Layer.provide(DesktopChannel.layer),
759 + Layer.provideMerge(dependencies),
760 + ),
761 + ),
762 + ),
763 +);
764 +
765 it.effect("an agent's tab the reloaded desktop dropped goes back to the desktop", () =>
766 Effect.scoped(
767 Effect.gen(function* () {
apps/server/src/preview/ServerBrowser.ts
+2 -2
@@ -887,8 +887,8 @@ const make = Effect.gen(function* () {
887 if (desktop) opened.push(desktop.close);
888 // Attaching over CDP emulates a light scheme; a tab on System follows the desktop's.
889 if (desktop) await desktop.page.emulateMedia({ colorScheme: null });
890 - // Otherwise a desktop that attaches late shows its own page, and the agent drives another.
891 - if (!desktop && desktopChannel.available) {
890 + // Otherwise a desktop that attaches late, or has no channel to draw it, shows its own page.
891 + if (!desktop) {
892 await runPromise(
893 manager
894 .markHeadless({ threadId: ThreadId.make(snapshot.threadId), tabId: snapshot.tabId })