fix(server): WSL browser tabs show pages typed in the address bar #28488
main fromrefs/pull/28488/head·opened View on GitHubProblem#
With the Windows desktop app running a WSL backend (wslOnly), typing a URL into the preview address bar appears to do nothing. The toolbar shows, but the panel stays on its empty state and there is no error.
Expected: the page loads in the panel.
Reproduce: on Windows, enable the WSL backend, open the preview panel, open a tab and enter any URL.
Change#
resolveWslStartConfig does not pass desktopBrowserFd or desktopBrowserControlFd, so a WSL backend gets the unavailable DesktopBrowserChannel. ServerBrowser.createTab then falls back to headless Chromium, but it only called markHeadless when desktopChannel.available was true, so the tab was left unmarked.
The Windows app sees the WSL environment as primary and the tab as not headless, so rendersServerTabNatively returns true. That has three effects:
- The app draws the tab in a local webview with
serverDrivenset, which suppressespreview.reportStatus. - The address bar calls
previewBridge.navigate, which succeeds in that webview, but the server never hears about it. navStatusstaysIdle, so the panel keeps showing the empty state.
The fix marks every tab that has no desktop page as headless, whether or not a channel exists. The Windows app then streams the tab over /api/preview-stream, as it does for other headless tabs. A WSL backend has no channel, so nothing else can draw these tabs.
The only other consumers of headless are desktopRenders, which already requires an available channel, and rendersServerTabNatively, which is the check this corrects.
Scope and approval#
There is no linked issue. This qualifies as a very small, focused fix for an obvious bug: the panel cannot show a page entered in the address bar on a WSL backend. The fix removes one condition and adds a regression test, with no product default or contract change.
Verification#
How the problem was established, on T3 Code 0.1.6, Windows desktop with a WSL Ubuntu backend:
- The desktop trace showed
desktop.ipc.preview.navigatesucceeding, and the tab's renderer was recreated at the same moment. - The server trace had no preview status report for that navigation, and
preview.liststill showedruntime: "server", noheadless, andnavStatus: Idle. - The server trace had no
/api/preview-streamspans, so the tab was not being streamed. - A headless Chromium renderer existed for each tab, which confirms the fallback path ran.
Focused tests in apps/server, including a new case with the channel unavailable:
vp test run src/preview/ServerBrowser.test.ts -t headlessfails without the fix (expected undefined to be true) and passes with it.vp test run src/previewpasses, 158 of 158, after mergingmain.vp fmt --checkis clean on both changed files.
Not checked:
- I did not run a patched packaged Windows and WSL build, so the end-to-end result is inferred from the code and the traces above. For the same reason there are no before/after screenshots.
- Streaming from the Windows app to a WSL backend is not confirmed working on this setup, because the bug meant that path was never reached.
Written with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 5732bbe
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
47c0f743-15a7-4d92-b546-9e2b82f4bdc6
Commits-
Reviewing files that changed from the base of the PR and between f9a072eaed0cc0b9f37211f511c9c6d66595eab0 and 98e6a7c5263d791ec73b72d681954a319aa6a055.
Files selected for processing: 1-
apps/server/src/preview/ServerBrowser.ts
Files skipped from review as they are similar to previous changes: 1-
- apps/server/src/preview/ServerBrowser.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
Walkthrough
-
createTabnow marks a tab headless whenever no desktop connection is established, including when the desktop channel is unavailable. A test verifies this case.Changes: Headless preview fallback
Layer / File(s) Summary Headless fallback condition
apps/server/src/preview/ServerBrowser.ts,apps/server/src/preview/ServerBrowser.test.tscreateTabmarks a tab headless when no desktop connection is established. The test mock exposes mutable channel availability, and a test checks the unavailable-channel case.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- pingdotgg/t3code#17009 — The issue reports a Windows/WSL browser failure when the desktop browser channel is unavailable. This change marks tabs headless in that condition.
- pingdotgg/t3code#27035 — The issue reports separate desktop and Linux pages when the desktop channel is unavailable. This change marks the tab headless in that condition.
- pingdotgg/t3code#26147 — The issue reports WSL address-bar navigation not reaching the server. This change marks tabs without a desktop connection headless.
Possibly related PRs
- pingdotgg/t3code#27043 — Both changes mark a tab headless when no desktop page connects, including when no desktop channel exists.
- pingdotgg/t3code#24238 — This PR prevents native webview rendering when the environment lacks a desktop browser channel.
- pingdotgg/t3code#22877 — This PR introduced the headless marker for server tabs that cannot attach to a desktop page.
Suggested labels:
bugfixSuggested reviewers:
t3dotgg,maria-rcks
Merge Risk:
Minimal · up to98e6a-
The WSL fallback has a server-side stream source for preview tabs. No actionable merge-blocking risk remains after normal checks.
Pre-merge checks:
4-
Check name Status Explanation Title check The title is concise, uses the conventional commit format, and clearly describes the WSL browser-tab fix implemented by the pull request. Description check The description covers the problem, reproduction steps, technical change, scope rationale, focused regression tests, formatting checks, and unverified end-to-end testing. It is complete and directly r… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Description check
-
Explanation
The description covers the problem, reproduction steps, technical change, scope rationale, focused regression tests, formatting checks, and unverified end-to-end testing. It is complete and directly related to the changes.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
🤖 GPT-6.1 Terra [1m] responding on behalf of Theo
Closing as a duplicate of the existing patch that marks an unattached tab headless and routes Windows rendering to the server tab the agent controls. #27043 ServerBrowser.ts
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
9ec918cMacroscope's review found this PR approvable — Marks server-rendered tabs as headless even when no desktop channel exists, allowing WSL preview tabs to use the existing streaming path. Attached desktop tabs remain unchanged, and the change is limited to preview rendering selection.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).