Skip to content

fix(wsl): label WSL environments with their Windows host on every client - #22629

Open
RJWadley wants to merge 4 commits into
pingdotgg:mainfrom
RJWadley:fix/wsl-duplicate-computer
Open

RJWadley wants to merge 4 commits into
pingdotgg:mainfrom
RJWadley:fix/wsl-duplicate-computer

Conversation

@RJWadley

@RJWadley RJWadley commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

T3's WSL integration labels its servers inconsistently, and in my opinion, badly.

Remotely, a windows WSL computer shows up multiple times in the client list and its difficult to determine which server is running in windows vs WSL.

Screenshot 2026-10-20 at 9 12 03 PM

On the box itself, the machine is properly designated as WSL, but the host is missing. This is less confusing, but still pretty bad if you have more than one box using WSL.

Change

T3 code's built in WSL support will consistently label as
HOSTNAME WSL (distro)
across all clients

Scope and approval

No prior maintainer approval; submitting under the small, focused fix of an oversight.

WSL inherits the Windows hostname, causing two different environments to appear with identical names on remote clients. Reported in #4820; the earlier fix in #6053 was closed without merging.

This change consistently labels the environments HOST and HOST WSL (distro) on desktop and remote clients. It corrects existing environment labels without adding settings, capabilities, or contract changes.

Verification

40 focused tests passed across:

  • apps/server/src/environment/ServerEnvironmentLabel.test.ts
  • apps/desktop/src/ipc/methods/window.test.ts
  • apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
  • apps/desktop/src/wsl/DesktopWslBackend.test.ts
  • apps/web/src/connection/platform.test.ts

The new server tests verify WSL labels with and without a distro name, and that non-WSL Linux retains its hostname. Updated desktop assertions verify both connected and pending WSL bootstrap labels.

Ran the original and patched label resolvers on a real Ubuntu WSL2 environment:

  • Before: computer
  • After: computer WSL (Ubuntu)

Targeted type checks passed for server, desktop, web, and shared packages. Lint and formatting checks passed for the changed files.

Not yet verified: Windows desktop UI and remote web/mobile behavior end to end.

Implementation: Claude Opus 5.5 through the Claude Code harness in T3 Code.
Verification: gpt-6.1-sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 21, 2026
@RJWadley
RJWadley force-pushed the fix/wsl-duplicate-computer branch from 1b91937 to 82ab469 Compare October 21, 2026 04:19
@macroscopeapp

macroscopeapp Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — This focused fix changes the default environment labels shown across desktop, server, and web clients, adding the Windows hostname to WSL labels and changing the Windows label itself. The runtime scope is narrow, but the product-default display behavior has changed and should receive human review.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

WSL environment labels now include the host name and, when available, the distribution name. Desktop and server labeling use a shared formatter. Windows uses the host name for non-WSL labels, and secondary connection registration prefers a nonempty server descriptor label.

Changes: Environment labels

Layer / File(s) Summary
Add shared WSL label formatter
packages/shared/src/environmentLabel.ts, packages/shared/package.json
The shared package exports wslEnvironmentLabel, which formats WSL labels with a host name and optional distribution.
Resolve server WSL labels
apps/server/src/environment/ServerEnvironmentLabel.ts, apps/server/src/environment/ServerEnvironmentLabel.test.ts
The server checks the Linux kernel release for WSL and uses the host name and WSL_DISTRO_NAME for its label. Tests cover WSL with and without a distribution and non-WSL Linux.
Apply labels to desktop registrations
apps/desktop/src/backend/DesktopBackendConfiguration.ts, apps/desktop/src/backend/DesktopBackendConfiguration.test.ts, apps/desktop/src/wsl/DesktopWslBackend.ts, apps/desktop/src/ipc/methods/window.ts, apps/desktop/src/ipc/methods/window.test.ts, apps/web/src/connection/platform.ts
Desktop labels use the host name and shared WSL formatter. Windows uses the host name for non-WSL labels; other platforms retain “Local environment.” Secondary connection registration prefers the descriptor label when it is not empty.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#27463 — The hostname-based WSL labels add a WSL suffix, but the changes do not remove the environment row or change its route controls.
  • pingdotgg/t3code#15683 — The connection registration now uses the live descriptor label when it is nonempty.

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to cffa7

No actionable merge-blocking risk is established for this change.

Security architecture risk: Minimal · up to 82ab4

The changes standardize environment names without changing backend identifiers, connection endpoints, credentials, or permissions. No material security risk was identified in the changed behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The changed values enter label fields on existing desktop bootstrap and bearer-connection registrations. Endpoints, backend routing IDs, environment IDs, and credentials are populated independently of the label text.

Trust Boundaries and Controls

  • observed — Secondary connections now accept server-supplied display text preferentially, as primary connections already do. Bearer bootstrap still uses the desktop-provided endpoint and bootstrap token with the existing standard client scopes; the label does not determine that authority.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: WSL environments are now labeled with their Windows host name on every client. It matches the summarized changes to labels in the desktop, server, and web code, and th…
Description check Passed The description follows the template's sections (Problem, Change, Scope and approval, Verification) and explains the mislabeling problem with a screenshot. The Change section is brief, but it states t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: WSL environments are now labeled with their Windows host name on every client. It matches the summarized changes to labels in the desktop, server, and web code, and the PR objectives. It follows the conventional commit style that the template suggests.

Full details: Description check

Explanation

The description follows the template's sections (Problem, Change, Scope and approval, Verification) and explains the mislabeling problem with a screenshot. The Change section is brief, but it states the new label format. The Scope section gives a clear reason for the fix and cites the prior issue and PR. The Verification section lists the tests run, a real WSL2 before-and-after check, and the unverified areas. Two gaps remain. The Problem section still has the template placeholder comment and lacks a reproduction-steps line. The author also acknowledges that no maintainer approval exists, and the template asks for approval or a stated exemption. The objectives note that maintainer approval of the default-label change is still required, so the description is mostly complete but has a scope gap that a reviewer must resolve.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e76d149 and cffa7cf.

Files selected for processing: 7

  • apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
  • apps/desktop/src/backend/DesktopBackendConfiguration.ts
  • apps/desktop/src/ipc/methods/window.test.ts
  • apps/desktop/src/ipc/methods/window.ts
  • apps/web/src/connection/platform.ts
  • packages/shared/package.json
  • packages/shared/src/environmentLabel.ts

Limit details: You’ve used all 10 included reviews currently available.

@RJWadley
RJWadley force-pushed the fix/wsl-duplicate-computer branch from 82ab469 to 1ef2295 Compare October 26, 2026 00:26
WSL inherits the Windows computer name as its hostname, so remote clients
showed the Windows and WSL servers under the same name. The server now
reports "HOST WSL (distro)" when running in WSL, and the desktop app uses
the same format instead of "Windows" / "WSL (distro)", so the host and
remote clients agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RJWadley
RJWadley force-pushed the fix/wsl-duplicate-computer branch from 1ef2295 to e76d149 Compare October 26, 2026 00:53

maria-rcks commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

thanks RJWadley. i kept your implementation and commit, merged current main without rebasing, removed redundant comments, and strengthened the existing windows primary-label test to assert the hostname instead of merely checking for a string. no label paths or supported cases were dropped.

verification: reproduced both wsl server-label failures against main, plus the windows primary returning Windows instead of the hostname. all 44 focused tests and vp run check:changed passed on blacksmith, including formatting, lint, knip and affected typechecks. all 27 ci checks are green on c106818467b8ea42f99574419fab0b0731888b80. two independent gpt-6.1-sol reviews found no blocker, should, or nit findings. coderabbit skipped the new review because its allowance was exhausted; no bot was invoked.

the real web client below uses the same task server and data with an isolated simulated wsl operating environment: hostname DESKTOP-PC, microsoft kernel release, and WSL_DISTRO_NAME=Ubuntu. the before capture uses main's label resolver; the after uses this pr's resolver. no ui or descriptor responses were mocked. this verifies the descriptor-to-web path, not a native windows installation.

unverified: native windows desktop, real wsl, native mobile, and relay/tunnel connections. this linux vm cannot establish those native paths. maintainer approval of the default-label change is still required.

before: main's resolver displays DESKTOP-PC in connections

after: the wsl server descriptor displays DESKTOP-PC WSL (Ubuntu) in connections

Note

Written by claude-opus-5-5 on behalf of Maria

update: merged current main again without rebasing (cffa7cf317). the only conflict was an import line in DesktopBackendConfiguration.ts; both sides kept. vp run check:changed and the 29 focused label tests passed on blacksmith. all ci checks are green and the pr is mergeable.

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

checked github/main 9ebca5f71cbcf050e94732f0a1da041073223c84 in /home/user/main, then the exact contributor head c106818467b8ea42f99574419fab0b0731888b80. ran vp i in each checkout and background dev servers one at a time. used repository Playwright with /usr/bin/google-chrome against the actual web clients. no mocks, seeded fixtures, simulated kernel, or label overrides were used.

neighboring linux behavior passed on both revisions: added /home/user/t3code through the local-folder flow, selected codex gpt-6.1-sol, sent a real provider turn through the local proxy, and received sol linux connection verified.. on the pr, a further real sol turn completed after restarting with isolated state outside the repository. pairing, persisted thread history, and navigating settings to the machine label worked.

short server transcript:

$ cat /proc/sys/kernel/osrelease
6.8.0-117-generic
$ command -v wsl.exe
(no executable)
$ curl http://127.0.0.1:16733/.well-known/t3/environment  # main
label: box-node-bb4f04381d18bd81; platform: linux/x64; serverVersion: 0.1.3
$ curl http://127.0.0.1:13773/.well-known/t3/environment  # exact pr head
label: box-node-bb4f04381d18bd81; platform: linux/x64; serverVersion: 0.1.2

the screenshots show the same real linux host on main and the pr. they are neighboring-behavior evidence, not a reproduction of the wsl bug. main has newer settings navigation than this pr. the recording shows opening settings and connections on the pr; its startup splash was trimmed. uploaded images loaded successfully, and the uploaded recording played to completion and supported seeking.

main: real linux hostname in sharing and access

pr: the same real linux hostname in connections

pr: real codex gpt-6.1-sol response

pr: opening settings and connections in the real web client

Not verified

this linux vm has neither windows nor wsl. i could not reproduce the original duplicate-name bug on main or exercise any changed wsl label path on the pr. native windows desktop bootstrap labels, pending/running wsl distro labels, the secondary desktop registration descriptor-label preference, native mobile, and relay/tunnel connections remain unverified. the earlier simulated-wsl evidence in this discussion does not establish these native paths.

one isolated pr server startup stalled for more than 10 minutes before becoming usable. this is a finding, with no demonstrated causal connection to the label diff. a fresh blacksmith focused-check command (vp i followed by the five existing server/desktop/web test files listed in the description) timed out after 900 seconds without returning test results. the worker is already stopped. existing head ci reports 27 successful, zero pending, zero failing checks; that is not a substitute for the missing runtime proof.

result: unverifiable for the requested wsl fix on this vm. linux neighboring paths passed. no source changes, commits, pushes, labels, merges, closes, rebases, or force-pushes were made.

…puter

# Conflicts:
#	apps/desktop/src/backend/DesktopBackendConfiguration.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants