You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(wsl-host): a paired phone reaches the desktop's WSL host and never starts its distro (E6) - #33911
Do not merge yet: this still needs the real-device phone check in Testing. It is marked ready only so the full CI runs.
Files
Added
Deleted
Net
Test
12
$\color{#1a7f37}{\Huge{\mathbf{+}}}$891
$\color{#cf222e}{\Huge{\mathbf{−}}}$116
$\color{#1a7f37}{\Huge{\mathbf{+}}}$775
Prod
15
$\color{#1a7f37}{\Huge{\mathbf{+}}}$378
$\color{#cf222e}{\Huge{\mathbf{−}}}$55
$\color{#1a7f37}{\Huge{\mathbf{+}}}$323
ELI5
On Windows, Orca can now run your projects inside a WSL distro (the "WSL host", behind an internal switch). Until now a phone paired with that computer simply couldn't see those projects. With this change the phone sees and uses them through the computer, the same way it already uses a remote server the computer is connected to. One hard rule: the phone never starts a stopped distro. If it isn't running, the phone says so and tells you to start it on the computer.
What Changed
Before (switch on): WSL host projects, terminals and agent launches were missing on the phone and in the phone's sidebar, and a push for an agent there had nothing to open.
After (switch on):
The phone lists the WSL host next to the computer's other servers and can list its projects, open files, run terminals and launch agents there. All of it goes through the computer.
Once the computer has confirmed the distro stopped, its rows on the phone carry a "Start on computer" badge, and calls are refused with "The WSL host Ubuntu isn't running. Open one of its projects on your computer to start it." While it's starting, reconnecting or can't be confirmed, the phone gets a neutral "isn't available from your phone right now" message and no badge. Either way, nothing gets started.
Every call the computer passes along for a phone (resolve, call, watchChanges, and status.get) carries a "never start" flag. For a WSL host, it goes through a new WslHostPhoneGate (src/main/wsl/wsl-host-phone-reach.ts). The gate reuses the focus check from the change that boots only the focused WSL host. If this process has no bridge to the distro, the call is refused right away, without spawning wsl.exe. Otherwise it reads reachability(). Only available serves the call; a confirmed stopped is remembered for the phone's copy; anything else gets the neutral message. This holds even while the computer has open work for that host.
Phones don't see WSL hosts while the Experimental switch is off or a Remove is pending, not only while the internal gate is closed.
A WSL host's last status counts only while the computer holds it ready, so it never shows as stale-ready.
The computer's background list of each server's workspaces (the source of the main-computed sidebar feed the phone reads) now includes the WSL host like any other server. It only watches a host while it's connected, and every fetch uses the never-start flag. On the computer's own sidebar this changes nothing while that feed is off, which it is in shipped builds. With it on, the WSL host's rows come from the same feed as every other server's.
The host list sent to the phone gains two optional flags: stoppedOnDesktop: true for a confirmed stop (badge "Start on computer"), and unavailableOnDesktop: true for a WSL host this computer isn't connected to and doesn't know is stopped (badge "Open on computer"). A confirmed stop is tied to that host's own last status and lapses when the host publishes any new status.
Why
The relay, delegated phone devices, workspace rows, terminals, agent launch and push routing already work for managed SSH servers, and this is the same server code. The only WSL-specific risk was waking the distro, so the change is one "never start" switch on the relay's call path instead of a separate phone path. Starting a distro from the phone was left out on purpose. If it's wanted later, it should be a prompt on the computer, never a silent start.
Supersedes the draft prototype #31490, rebased on current main with the remaining work done.
Mixed versions:
No new stream opcode or RPC method. stoppedOnDesktop and unavailableOnDesktop are optional.
An older phone ignores both flags (its parser keeps unknown keys). It shows a stopped or not-connected WSL host as "Connecting" indefinitely. That's cosmetic: those phones can't start anything, and every call is refused with the message.
A newer phone paired with an older computer gets no marker and no WSL host, and draws exactly as before (tested).
isConnected on the WSL service is untouched; the phone's view is WslHostPhoneGate.reach.
Linked Issue
N/A (internal WSL host work, gate E6).
Visual Proof
N/A. The only visible change is the text of an existing badge on a phone row ("Start on computer"), and it shows only with the internal WSL switch on and a stopped distro. Unit tests cover it, and the real-device check is listed below.
Testing
I manually tested these changes locally (phone + Windows real-device check still to do, listed below)
Automated tests added/updated
Unit: a phone's status.get checks only a WSL host; SSH-managed and plain paired servers reach the status probe exactly as on main (no reconnect or redeploy); a stopped reading is dropped if the host turned ready during the check, and a check that finds the host answering clears an earlier stop; managed tunnel no-start branch; WslHostPhoneGate (stopped only for a confirmed stop, neutral otherwise, no running-list read without a bridge, hidden while the switch is off or a Remove is pending, a ready status clears a stop); relay hosts (switch closed hides WSL hosts, switch open lists them, no-start flag on every path, status only while connected); new: a no-start status.get is refused before the status probe dials; new: the background rows list carries a WSL host's rows, keeps them as unverifiable once it stops, and makes no further calls; push host id for a WSL worktree.
Mobile: new: reads stoppedOnDesktop from a newer computer and ignores a bad value; an older computer's list (no marker, no WSL host) shows only the usual health word; "Start on computer" appears only for a stop the computer confirmed (not while starting or reconnecting).
E2E tests/e2e/wsl-host-paired-phone.spec.ts (fake WSL transport): the phone lists the host, lists its project, reads a directory, creates a terminal and launches an agent. Then the distro "stops": calls are refused with the message, the host lists as unavailable, and no new start is logged. A second refused call replaces the old 2-second sleep.
Local runs: pnpm tc, tc:web, typecheck:ci, oxlint on touched files and check:code-quality:changed pass, along with the touched unit suites (desktop 175 tests over 15 files, mobile 23 tests). The e2e spec wasn't re-run locally because the machine was under heavy load; CI covers it.
The paired-phone e2e also checks that distros.json still reads stopped at the end, since the fake boots a distro by rewriting that file.
Real-device check (needs a Windows box with a phone):
With the switch on and the distro running, pair a phone. On the phone, open a WSL project, run a terminal, launch an agent.
Let the agent finish and tap the push. It should open that worktree.
Run wsl --terminate Ubuntu with the project closed on the computer. On the phone, open the row: once the computer notices the stop you should see the "Start on computer" badge and the "isn't running" message. Before that, you'll see the neutral message. wsl --list --running must stay empty.
Repeat step 3 with the project open on the computer. The computer may restart the distro for its own work; the phone must not.
AI Disclosure
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
SSH: the never-start flag does nothing for SSH-managed and paired servers.
Folder workspaces: rows are the server's own worktree.ps rows, folder workspaces included.
Known limit: a stop is noticed on the next call or status event, not instantly. A call already in flight when the distro stops could still dial its bridge. That window is milliseconds, and the next call is refused.
Checklist
This PR is small and focused
I explained what changed and why
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (typecheck and touched tests locally; full lint/test left to CI per load rule)
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 17477847-2cf1-4b7d-9f39-210663a1d3f4
Commits
Reviewing files that changed from the base of the PR and between 0fbb6c3 and aa8127e.
Files selected for processing: 1
tests/e2e/wsl-host-fake-transport.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
Walkthrough
The change adds a WSL phone reachability gate and passes no-start preparation options through managed runtime resolution, calls, and subscriptions. Relay listings expose stopped or unavailable state for WSL hosts. The mobile client uses that state to label worktree rows. Tests cover reachability, transport routing, relay listings, and paired-phone access before and after a WSL distro stops.
Priority: Normal
Merge Risk: Low · previous review aa812
The E2E helper should explicitly force background mode before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly identifies the main change: enabling paired phones to reach a desktop WSL host without starting its distro.
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.
Description check
The description covers the required sections, explains the change and rationale, and documents testing. It clearly states that the Windows real-device phone check remains pending and that the PR shoul…
Full details: Description check
Explanation
The description covers the required sections, explains the change and rationale, and documents testing. It clearly states that the Windows real-device phone check remains pending and that the PR should not be merged until that check is complete.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Maintainability & Code Quality · Quick win
Supported by static analysis
Script executed:
sed -n '45,76p' tests/e2e/helpers/wsl-host-fake-desktop.ts
rg -n 'ORCA_BACKGROUND_LAUNCH|ORCA_E2E_HEADLESS|ORCA_E2E_FOREGROUND' src/main/window/foreground-activation-policy.ts tests/AGENTS.md
Repository: stablyai/orca
Length of output: 2065
Script executed:
set -u
rg -n 'ORCA_BACKGROUND_LAUNCH|ORCA_E2E_HEADLESS|ORCA_E2E_HEADFUL|ORCA_E2E_FOREGROUND' tests/e2e/helpers/ ||test"$?" -eq 1
echo'--- electron-home-isolation.ts ---'
sed -n '1,80p' tests/e2e/helpers/electron-home-isolation.ts
echo'--- wsl-host-fake-desktop.ts 1-45 ---'
sed -n '1,45p' tests/e2e/helpers/wsl-host-fake-desktop.ts
echo'--- foreground-activation-policy.ts 1-45 ---'
sed -n '1,45p' src/main/window/foreground-activation-policy.ts
Repository: stablyai/orca
Length of output: 8748
Set ORCA_BACKGROUND_LAUNCH=1 explicitly in this raw electron.launch() call.
The tests/** guideline requires raw electron.launch() calls to pass ORCA_BACKGROUND_LAUNCH=1 explicitly. This env sets ORCA_E2E_HEADLESS only. The variable reaches the second desktop only when the runner's inherited environment already sets it. Set it in this call so an inherited ORCA_E2E_FOREGROUND=1 cannot remove background mode. Background launch takes precedence over the foreground override, but only when the variable is set explicitly.
Per the tests/** guideline: "Set ORCA_BACKGROUND_LAUNCH=1 for all tests and agent-launched apps... raw electron.launch() calls must pass the env explicitly."
Committable suggestion
IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
The reason will be displayed to describe this comment to others. Learn more.
Open connections lack stop coverage
The test closes the working phone socket before stopping the distro, then opens a fresh socket. This checks WslHostPhoneGate during setup, but misses a phone that already has the project open. MobileDesktopRelay.linkFor reuses an existing link without calling hosts.resolve, so that flow depends on the bridge closing correctly.
Keep the original socket open across the stop and check that another call is refused without starting the distro. The fake connector also needs to end its existing link when the distro stops; removing its saved bridge alone leaves the direct connection to the fixture server usable.
…er starts its distro (E6)
Behind ORCA_INTERNAL_WSL_HOSTS and the Experimental switch. The desktop relay
lists its WSL hosts to phones. Every relayed call (resolve, call, watchChanges,
status.get) passes a never-start check, and a WSL host serves a phone only
while it already runs.
- WslHostPhoneGate holds the phone's view. The call check reuses E9's
focusReachability, so with no bridge in this process it refuses without a
running-list read. A host shows as "stopped" only on a confirmed stop
(liveness's distro-stopped, or a running list read by the check); anything
else gets a neutral "isn't available" message. Hosts are hidden from phones
while the Experimental switch is off or a Remove is pending.
- The relay host list sends optional `stoppedOnDesktop` only for a confirmed
stop. The phone badges those rows "Start on computer"; older peers ignore
the field.
- The paired-server rows producer carries WSL hosts like any server, so the
main-computed sidebar feed a phone reads has their rows.
- The paired-phone e2e drives a WSL host project end to end and asserts a
stopped distro is never started.
…nd a stale stop off a ready host
- status.get runs the no-start check only for a WSL host, through a
check-only helper. SSH-managed and paired servers reach the status owner
exactly as on main: no reconnect, no redeploy, and the manual-disconnect,
coalescing and repair handling stay in place. The preparation option is
stripped before the probe.
- WslHostPhoneGate drops a 'stopped' read when a ready status arrived while it
ran (a per-host ready generation), and clears a recorded stop when a check
finds the host answering.
- A phone asking about a host that is switched off or being removed gets copy
that says so, not "open one of its projects".
…, and label a host not connected
- A stop a phone's check confirmed is stored with that host's own status
object and holds only while that status is current. Another host's change no
longer clears it. Any status of its own (ready, a disable's closed, a failed
Remove's closed) does. A read never records a stop over a ready status, so a
read shared with one begun before ready can't. Removed hosts drop their
entry. The generation map and status listener are gone.
- The relay sends optional `unavailableOnDesktop` for a WSL host this desktop
isn't connected to and doesn't know is stopped. New phones badge it "Open on
computer"; older ones still show Connecting.
- The relay list reads the WSL host records once per poll (reachAll).
…-phone e2e
toMatchObject({ stoppedOnDesktop: undefined }) requires the key to be
present, and the desktop omits an unset flag, so the ready poll could never
match. The poll now compares relay plus both flags read as booleans.
…topped distro's bridge as closed
Main's fake connector (#34573) now publishes 'closed' when a stopped distro's
bridge drops, not liveness's 'distro-stopped'. So the phone's check reads the
stop under a ready status and doesn't claim it. The phone gets the neutral
copy and unavailableOnDesktop; the confirmed-stop copy stays unit-tested.
…, and checks nothing booted the distro
Main's fake now publishes 'distro-stopped' when it drops a stopped distro's
bridge (#34624), as liveness does, so the phone gets "isn't running" and
stoppedOnDesktop. The spec also checks distros.json still reads 'stopped' at
the end: the fake boots a distro by rewriting it.
…t beside the service
The reconcile still runs before the connector exists; the suite only lacked the new
setWslHostPhoneGate export on its service-instance mock.
Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
On Windows, Orca can now run your projects inside a WSL distro (the "WSL host", behind an internal switch). Until now a phone paired with that computer simply couldn't see those projects. With this change the phone sees and uses them through the computer, the same way it already uses a remote server the computer is connected to. One hard rule: the phone never starts a stopped distro. If it isn't running, the phone says so and tells you to start it on the computer.
What Changed
Before (switch on): WSL host projects, terminals and agent launches were missing on the phone and in the phone's sidebar, and a push for an agent there had nothing to open.
After (switch on):
executionHost, from feat(push): accept a notification's workspace server #26516), so tapping it opens the worktree through the computer.Mechanism:
resolve,call,watchChanges, andstatus.get) carries a "never start" flag. For a WSL host, it goes through a newWslHostPhoneGate(src/main/wsl/wsl-host-phone-reach.ts). The gate reuses the focus check from the change that boots only the focused WSL host. If this process has no bridge to the distro, the call is refused right away, without spawningwsl.exe. Otherwise it readsreachability(). Onlyavailableserves the call; a confirmedstoppedis remembered for the phone's copy; anything else gets the neutral message. This holds even while the computer has open work for that host.stoppedOnDesktop: truefor a confirmed stop (badge "Start on computer"), andunavailableOnDesktop: truefor a WSL host this computer isn't connected to and doesn't know is stopped (badge "Open on computer"). A confirmed stop is tied to that host's own last status and lapses when the host publishes any new status.Why
The relay, delegated phone devices, workspace rows, terminals, agent launch and push routing already work for managed SSH servers, and this is the same server code. The only WSL-specific risk was waking the distro, so the change is one "never start" switch on the relay's call path instead of a separate phone path. Starting a distro from the phone was left out on purpose. If it's wanted later, it should be a prompt on the computer, never a silent start.
Supersedes the draft prototype #31490, rebased on current main with the remaining work done.
Mixed versions:
stoppedOnDesktopandunavailableOnDesktopare optional.isConnectedon the WSL service is untouched; the phone's view isWslHostPhoneGate.reach.Linked Issue
N/A (internal WSL host work, gate E6).
Visual Proof
N/A. The only visible change is the text of an existing badge on a phone row ("Start on computer"), and it shows only with the internal WSL switch on and a stopped distro. Unit tests cover it, and the real-device check is listed below.
Testing
I manually tested these changes locally (phone + Windows real-device check still to do, listed below)
Automated tests added/updated
Unit: a phone's
status.getchecks only a WSL host; SSH-managed and plain paired servers reach the status probe exactly as on main (no reconnect or redeploy); a stopped reading is dropped if the host turned ready during the check, and a check that finds the host answering clears an earlier stop; managed tunnel no-start branch;WslHostPhoneGate(stopped only for a confirmed stop, neutral otherwise, no running-list read without a bridge, hidden while the switch is off or a Remove is pending, a ready status clears a stop); relay hosts (switch closed hides WSL hosts, switch open lists them, no-start flag on every path, status only while connected); new: a no-startstatus.getis refused before the status probe dials; new: the background rows list carries a WSL host's rows, keeps them as unverifiable once it stops, and makes no further calls; push host id for a WSL worktree.Mobile: new: reads
stoppedOnDesktopfrom a newer computer and ignores a bad value; an older computer's list (no marker, no WSL host) shows only the usual health word; "Start on computer" appears only for a stop the computer confirmed (not while starting or reconnecting).E2E
tests/e2e/wsl-host-paired-phone.spec.ts(fake WSL transport): the phone lists the host, lists its project, reads a directory, creates a terminal and launches an agent. Then the distro "stops": calls are refused with the message, the host lists as unavailable, and no new start is logged. A second refused call replaces the old 2-second sleep.Local runs:
pnpm tc,tc:web,typecheck:ci, oxlint on touched files andcheck:code-quality:changedpass, along with the touched unit suites (desktop 175 tests over 15 files, mobile 23 tests). The e2e spec wasn't re-run locally because the machine was under heavy load; CI covers it.The paired-phone e2e also checks that
distros.jsonstill readsstoppedat the end, since the fake boots a distro by rewriting that file.The wait-for-prompt fix to
wsl-host-fake-transport.spec.tslanded on main separately in test(wsl-host): type into the WSL host terminal only after its shell prompt #34607. The underlying dropped input is a separate follow-up.Real-device check (needs a Windows box with a phone):
wsl --terminate Ubuntuwith the project closed on the computer. On the phone, open the row: once the computer notices the stop you should see the "Start on computer" badge and the "isn't running" message. Before that, you'll see the neutral message.wsl --list --runningmust stay empty.AI Disclosure
Review
Agent skill upstream boundary
Notes
worktree.psrows, folder workspaces included.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (typecheck and touched tests locally; full lint/test left to CI per load rule)