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
test(wsl-host): native chat on a WSL host through the fake transport, including a stopped distro - #34573
This adds an end-to-end test that opens a native Claude chat from the desktop on a project that lives on a WSL host. The test checks four things: the chat starts, the reply streams in, the chat refuses cleanly while the distro is stopped (it doesn't quietly start it), and the chat carries on once the user switches back to the project, which starts the distro again.
What Changed
New spec tests/e2e/wsl-host-chat.spec.ts. The HUB app stands in for the distro's orcad and runs the existing Claude stub. A second desktop runs with the fake WSL transport (ORCA_E2E_FAKE_WSL_HOSTS, behind ORCA_INTERNAL_WSL_HOSTS). The test then:
adds the distro as a host and adds a git project on it;
checks that the host answers agentSession.createSupport with supported: true;
opens a Claude chat through New tab and sees the stub's reply stream in;
marks the distro stopped and checks that chat calls fail with "Ubuntu was stopped…" and nothing tries to start the distro;
switches away from the project and back, checks that this one action starts the distro, and sends again until a new reply arrives.
It saves screenshots of the streamed, stopped and after-start states.
Fake connector (src/main/wsl/wsl-host-e2e-fake-connector.ts). A distro that a test marks stopped in distrosFile now drops its bridge and reports stopped. A no-boot reconnect is refused, and a plain connect starts the distro, as wsl.exe would. Fixed listings and specs that never stop a distro behave exactly as before. A unit test pins this behaviour.
Why
Until now, native chat on a WSL host had only been proven at the RPC level on real distros. The desktop's UI path, and how it behaves when the distro stops, had never been run. This spec is new rather than an edit of wsl-host-fake-transport.spec.ts because two open PRs (#34530 and #33911) edit that file. The launch helper is a minimal copy, because the shared one in #33911 isn't on main yet. It should move into that helper once #33911 lands.
Linked Issue
N/A (maintainer).
Visual Proof
The screenshots are saved as test artifacts in the e2e run.
Testing
pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed, oxlint, and pnpm test src/main/wsl/wsl-host-e2e-fake-connector.test.ts pass locally.
I didn't run the e2e spec locally because the Mac is heavily loaded. CI's e2e job on this PR is the proof.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Flag-off / user risk: none. These are test files plus the e2e-only fake connector, which is active only under ORCA_E2E_FAKE_WSL_HOSTS.
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
The Claude stub is POSIX-only, so the spec skips on Windows, like the other stub specs.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
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 (or CI will cover; local preferred)
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: 74a63025-59f6-4416-aa33-cf7f640c6542
Commits
Reviewing files that changed from the base of the PR and between 40357e0 and 846844d.
Files selected for processing: 4
config/scripts/pr-e2e-route-contracts.test.mjs
config/scripts/pr-e2e-source-routing.mjs
src/main/wsl/wsl-host-e2e-fake-connector.ts
tests/e2e/wsl-host-chat.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Walkthrough
The fake WSL connector now reads distro state from a file and updates stopped distros when a connection can boot them. It reports stopped distros as stopped and removes their active bridges. New tests cover these connector behaviors and a WSL-host chat flow, including rejection while Ubuntu is stopped and reconnection after switching projects.
Priority: Low
Merge Risk: Low · up to 84684
The new WSL chat test still needs the required background-launch setting; this is a bounded test-fixture risk to address before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly identifies the main change: native chat testing on a WSL host through the fake transport, including stopped-distro behavior.
Description check
The description is detailed and mostly complete. It covers the user-facing behavior, implementation changes, rationale, linked-issue status, visual proof, testing, risk, platform considerations, and c…
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 is detailed and mostly complete. It covers the user-facing behavior, implementation changes, rationale, linked-issue status, visual proof, testing, risk, platform considerations, and checklist items. The explicit AI Disclosure heading is omitted, but this is non-critical for a maintainer PR.
Full details: Docstring Coverage
Explanation
Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 9 functions across 5 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
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.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
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: b8b200fd-ee99-4b4c-8cea-181db09b99af
Commits
Reviewing files that changed from the base of the PR and between 917ef9c and 40357e0.
Files selected for processing: 3
src/main/wsl/wsl-host-e2e-fake-connector.test.ts
src/main/wsl/wsl-host-e2e-fake-connector.ts
tests/e2e/wsl-host-chat.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
When stopServer has no active bridge, it calls connect(distro) with no intent. A stopped distro has no bridge, because reachability calls dropBridge for it. The connect call then takes the boot branch and writes running to distrosFile. The connector contract says stopServer "never boots a stopped distro", and the removal path relies on that. In the fake harness, removing a stopped host therefore starts the distro and leaves it running.
Change stopServer so it does not call connect for a stopped distro. It should return the proven-stop result that the contract describes. This matters only when distrosFile is set. Without it, connect throws instead, and the removal path reports the result as unverifiable.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
sed -n '35,70p' tests/e2e/wsl-host-chat.spec.ts
rg -n 'ORCA_BACKGROUND_LAUNCH|ORCA_E2E_HEADLESS|ORCA_E2E_FOREGROUND' src/main/window/foreground-activation-policy.ts tests/AGENTS.md tests/e2e/AGENTS.md
Repository: stablyai/orca
Length of output: 2711
Script executed:
#!/bin/bash
nl -ba src/main/window/foreground-activation-policy.ts | sed -n '1,80p'printf'\n--- tests/AGENTS.md ---\n'
nl -ba tests/AGENTS.md | sed -n '1,35p'printf'\n--- tests/e2e/AGENTS.md ---\n'
nl -ba tests/e2e/AGENTS.md | sed -n '1,35p'
Repository: stablyai/orca
Length of output: 7622
Pass ORCA_BACKGROUND_LAUNCH=1 explicitly to electron.launch().
This E2E fixture is not covered by a window-presentation exception. Although ORCA_E2E_HEADLESS=1 keeps the launch backgrounded by default, an inherited ORCA_E2E_FOREGROUND=1 can override that behavior. The test must satisfy the explicit launch contract.
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 fake's route
Find the prompt only in the transcript so the composer can't stand in for it,
re-check the boot-free stop window after unfocusing, right before the focus,
give the fake's distros.json temp file its own name so it can't collide with the
spec's, and test that the fake connector routes to both WSL host specs.
…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.
…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.
…ed terminal names its host (#34880)
* fix(wsl-mover): a moved project's chat opens and answers here; a fenced terminal names its host
New e2e: a moved project's existing chat still answers after the move, run by this computer's
agent, with no host involved. Writing it surfaced two product gaps:
- Opening the chat from the moved project's sidebar entry asked its composer for focus before
the prompt editor mounted; tiptap threw and the terminal workbench crashed. The editor handle
now focuses (and answers contains) only once its view is mounted.
- A new terminal in a project its WSL host now owns (one a chat's agent might ask for) was
refused with "is moving ... try again when the move finishes". It now names the host and the
way back: use the project on this computer again.
* test(wsl-mover): wait for the moved chat's composer before typing and sending
Like #34573: the composer must be editable before typing, and hold the typed text before Send.
…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.
…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.
…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.
…er starts its distro (E6) (#33911)
* feat(wsl-host): a paired phone reaches the desktop's WSL host and never 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.
* fix(wsl-host): keep the phone's no-start check off non-WSL servers, and 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".
* test(wsl-host): the real no-start helper leaves SSH-managed and paired servers untouched
* fix(wsl-host): tie a phone's confirmed WSL stop to that host's status, 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).
* refactor(wsl-host): one records read per phone check; note the gate's status identity compare
* test(wsl-host): read the phone's host flags as booleans in the paired-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.
* test(wsl-host): expect the neutral refusal once main's fake drops a stopped 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.
* test(wsl-host): the paired-phone e2e expects the confirmed stop again, 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.
* test(wsl-host): the startup reconcile suite stubs the phone gate built 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]>
---------
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
This adds an end-to-end test that opens a native Claude chat from the desktop on a project that lives on a WSL host. The test checks four things: the chat starts, the reply streams in, the chat refuses cleanly while the distro is stopped (it doesn't quietly start it), and the chat carries on once the user switches back to the project, which starts the distro again.
What Changed
New spec
tests/e2e/wsl-host-chat.spec.ts. The HUB app stands in for the distro's orcad and runs the existing Claude stub. A second desktop runs with the fake WSL transport (ORCA_E2E_FAKE_WSL_HOSTS, behindORCA_INTERNAL_WSL_HOSTS). The test then:agentSession.createSupportwithsupported: true;It saves screenshots of the streamed, stopped and after-start states.
Fake connector (
src/main/wsl/wsl-host-e2e-fake-connector.ts). A distro that a test marksstoppedindistrosFilenow drops its bridge and reportsstopped. A no-boot reconnect is refused, and a plain connect starts the distro, aswsl.exewould. Fixed listings and specs that never stop a distro behave exactly as before. A unit test pins this behaviour.Why
Until now, native chat on a WSL host had only been proven at the RPC level on real distros. The desktop's UI path, and how it behaves when the distro stops, had never been run. This spec is new rather than an edit of
wsl-host-fake-transport.spec.tsbecause two open PRs (#34530 and #33911) edit that file. The launch helper is a minimal copy, because the shared one in #33911 isn't on main yet. It should move into that helper once #33911 lands.Linked Issue
N/A (maintainer).
Visual Proof
The screenshots are saved as test artifacts in the e2e run.
Testing
pnpm tc,pnpm run typecheck:ci,pnpm run check:code-quality:changed, oxlint, andpnpm test src/main/wsl/wsl-host-e2e-fake-connector.test.tspass locally.I didn't run the e2e spec locally because the Mac is heavily loaded. CI's e2e job on this PR is the proof.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Flag-off / user risk: none. These are test files plus the e2e-only fake connector, which is active only under
ORCA_E2E_FAKE_WSL_HOSTS.Agent skill upstream boundary
Notes
The Claude stub is POSIX-only, so the spec skips on Windows, like the other stub specs.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)