Repository navigation
fix(wsl): open new WSL projects on their distro server - #28977
brennanb2025 wants to merge 81 commits into
Conversation
|
Adding a WSL folder could leave it owned by Windows, so the first agent launch could not open a native chat in the selected distro. This PR registers supported Add, Git Create, Open root, nested import, existing-folder setup and CLI Add operations on the distro’s server, then carries the returned owner through launch and restart. Saved Windows-owned projects retain their identity. Drive-mount paths keep Windows ownership. Review: the original source, architecture, reference and performance review is accepted. The audit fixes correct extended UNC placement, linked-worktree matching against an older guest, useful Add errors, all-failed nested import and drive-mount ownership. Ten regression cases failed before those fixes; the 28 tests in two named files then passed. The later drive-UNC Create repair passed independent review and its genuine failed-before regression (23 tests passed), plus the ordinary hook. The necessary main integration passed narrow review, its required hook, and 304 tests in 19 named files. Two later test-only fixture adaptations passed independent review, focused tests and ordinary hooks. Previous CI on The later blocking-conflict merge Real QA: the prior accepted run on Known limits: uncertain group-create replies and simultaneous same-folder Add can still leave duplicate groups or projects; both are temporary and tracked in STA-12331. If the desktop’s saved distro list is out of date, re-adding a project can still race an earlier removal. Orca keeps the returned project and does not cancel a different owner’s pending removal. This temporary edge is also tracked in STA-12331. Mixed saved-Windows/new-WSL Group import refuses with import-separately guidance (#31417). New projects created on a distro’s server cannot be reached from phones yet (#28972, #33911); saved Windows-owned WSL projects remain reachable. With the rollout gates on, new WSL 1 folders are refused with guidance under the #33085 decision; saved projects continue to work. Inferred Clone remains Windows-owned. Broader alias discovery (STA-11388), expanded owner-create ordering (STA-11252) and the existing drive-route follow-up (#33090) are unchanged. Paired/unnamed callers reuse supported saved projects but cannot create desktop-private WSL owners. Evidence limits: Add used the accepted one-call native-picker substitute; subsequent app actions completed through the real UI. OS picker interaction and physical drag/drop are not claimed as exercised. Folder-kind Create has no user entry point and has source-test coverage. The earlier authenticated paired run exercised real loopback handlers and verified catalogs/filesystem, without ensure-call instrumentation. The accepted a3 desktop used the explicitly accepted older official server payload, SHA256 For Brennan’s review — inspected screenshots: Targeted audit screenshots (viewed after hash-verified retrieval):
Review spots: Windows-owned Create filesystem access and nested import before provisioning. The source head is |
Brings the branch onto current main before the remaining review fixes. The new-tab chat launch files take main's version here; the corrected chat launch admission is folded back in by the following commits.
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
199d61eb-743d-40b7-852d-abe02edea2f0
📒 Files selected for processing: 74
src/cli/handlers/repo.tssrc/cli/index-project-setup.test.tssrc/main/ipc/repos/local-repo-registration.tssrc/main/ipc/repos/nested-repo-import-handler.tssrc/main/ipc/repos/project-host-setup-handlers.tssrc/main/ipc/repos/repo-clone-lifecycle.tssrc/main/ipc/repos/repo-creation-handlers.tssrc/main/ipc/wsl-host-handlers.tssrc/main/runtime/rpc/methods/project-runtime-rpc-methods.tssrc/main/runtime/rpc/methods/repo.tssrc/main/runtime/runtime-nested-repo-import.tssrc/main/runtime/runtime-project-host-setup-controller.tssrc/main/runtime/runtime-repository-clone-controller.tssrc/main/runtime/runtime-repository-registration-controller.tssrc/main/runtime/runtime-store-contract.tssrc/main/wsl/wsl-host-service-contract.tssrc/main/wsl/wsl-host-service.test.tssrc/main/wsl/wsl-host-service.tssrc/main/wsl/wsl-nested-project-import.tssrc/main/wsl/wsl-project-host-ensurer.tssrc/main/wsl/wsl-project-host-setup.tssrc/main/wsl/wsl-project-registration.test.tssrc/main/wsl/wsl-project-registration.tssrc/renderer/src/components/sidebar/AddProjectFromFolderDialog.tsxsrc/renderer/src/components/sidebar/AddRepoSteps.tsxsrc/renderer/src/components/sidebar/AddWslHostDialogBody.tsxsrc/renderer/src/components/sidebar/NonGitFolderDialog.tsxsrc/renderer/src/components/sidebar/add-repo-runtime-owner.tssrc/renderer/src/components/sidebar/add-repo-store-upsert.tssrc/renderer/src/components/sidebar/useAddRepoCloneFlow.test.tssrc/renderer/src/components/sidebar/useAddRepoCloneFlow.tssrc/renderer/src/components/sidebar/useAddRepoLocalFolderFlow.tssrc/renderer/src/components/sidebar/useAddRepoNestedImportFlow.tssrc/renderer/src/components/sidebar/useAddRepoServerPathFlow.test.tssrc/renderer/src/components/sidebar/useAddRepoServerPathFlow.tssrc/renderer/src/components/sidebar/useCreateRepo.default-checkout.test.tssrc/renderer/src/components/sidebar/useCreateRepo.tssrc/renderer/src/components/terminal/initial-terminal-admission-wait.test.tsxsrc/renderer/src/lib/agent-launch-caller-permissions.test.tssrc/renderer/src/lib/agent-launch-caller-placement.test.tssrc/renderer/src/lib/agent-launch-caller-prompt-transport.test.tssrc/renderer/src/lib/agent-launch-caller-routing.test.tssrc/renderer/src/lib/agent-launch-route-connection-fallback.test.tssrc/renderer/src/lib/agent-launch-route-input.test.tssrc/renderer/src/lib/agent-launch-route-input.tssrc/renderer/src/lib/agent-launch-route-registered-agents.test.tssrc/renderer/src/lib/agent-launch-routing.test.tssrc/renderer/src/lib/agent-launch-routing.tssrc/renderer/src/lib/empty-workspace-default-agent-chat.test.tssrc/renderer/src/lib/empty-workspace-default-agent-chat.tssrc/renderer/src/lib/launch-agent-in-new-tab-cwd.test.tssrc/renderer/src/lib/launch-agent-in-new-tab-host-agents.test.tssrc/renderer/src/lib/launch-agent-in-new-tab-host-agents.tssrc/renderer/src/lib/launch-agent-in-new-tab-placement.test.tssrc/renderer/src/lib/launch-agent-in-new-tab-structured-route.tssrc/renderer/src/lib/launch-agent-in-new-tab-web-runtime.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.test.tssrc/renderer/src/lib/launch-agent-in-new-tab.tssrc/renderer/src/lib/launch-agent-structured-chat-guard.test.tssrc/renderer/src/lib/launch-agent-web-host-tab.tssrc/renderer/src/lib/structured-agent-session-launch-admission.test.tssrc/renderer/src/lib/structured-agent-session-launch-admission.tssrc/renderer/src/lib/web-runtime-worktree-terminal-after-wake.tssrc/renderer/src/lib/worktree-activation-launch-awaiting-host.test.tssrc/renderer/src/lib/worktree-creation-structured-session.tssrc/renderer/src/store/project-groups/nested-repository-operations.tssrc/renderer/src/store/projects/project-host-setup-actions.tssrc/renderer/src/store/repos/repo-add-actions.tssrc/renderer/src/store/repos/repo-owner-host-readiness.tssrc/renderer/src/store/slices/repos-onboarding-folder-startup.test.tssrc/renderer/src/store/slices/repos-project-groups.test.tssrc/renderer/src/store/slices/repos-selected-owner-routing.test.tssrc/shared/project-group-types.tssrc/shared/structured-native-chat-launch-route.ts
💤 Files with no reviewable changes: 1
- src/renderer/src/lib/launch-agent-in-new-tab-host-agents.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.
Main deleted the explicit-runtime helper the launch admission read; the owner resolver it was folded into answers the same question. Also drops two imports the WSL service no longer uses.
…ct checks - Add (desktop and runtime) runs the usual path, Git root, real path and linked-worktree checks first; only a checkout no saved row claims goes to the distro's server. Runtime Add also reuses a linked worktree's main checkout and rechecks for a concurrent Add before inserting. - Create routes after main's own name and duplicate checks, so errors read as before. - A paired client is refused only when a new WSL project would be created; re-adding a saved project works. - Setup into a WSL folder carries the selected project's identity, and the dialogs select the setup the result names. - Nested import keeps selection order and each row's owner; an all-saved selection uses the local import, and a group mixing saved Windows and new WSL projects is refused before any work (temporary until saved projects can move to their distro). - A picked WSL subfolder becomes the first terminal's directory. - Clone into a WSL folder goes back to the existing Windows clone.
# Conflicts: # src/renderer/src/components/sidebar/useCreateRepo.ts # src/renderer/src/store/repos/repo-add-actions.ts


































ELI5
A project whose files live inside WSL (for example
\\wsl.localhost\Ubuntu\home\you\app) should run on that Linux distro, not on Windows. Until now, adding such a folder saved it as a Windows project, so Orca refused to start chat-view chats in it: the agent menu showed "No chat in WSL" and you could only open agents in a terminal. With this PR, adding a WSL folder registers the project with that distro's own Orca server. Chats then start and run inside WSL, and they keep working after Orca restarts.This only takes effect where WSL hosts are turned on, which today is an internal setting. Everyone else sees no change.
What Changed
Before: every way of adding a WSL folder saved it as a project belonging to Windows. Its files were in Linux, but Windows was in charge of it. Chats need to run on the machine that runs the project, so they were refused.
After: each way of adding a WSL folder asks one question first: which machine runs this folder? If the answer is a WSL distro, Orca starts that distro's Orca server if it isn't running yet (Orca already sets these servers up and pairs with them) and saves the project there. From then on, that server runs the project's chats, including after a restart. This covers:
\\wsl$\…and\\wsl.localhost\…pathsWhat stays the same, or is made safer:
No new saved settings and no new messages between apps, so older phones and paired servers keep working.
Why
The machine that runs a project should be the one in charge of it. That is how SSH projects already work in Orca, and it is the common pattern for remote projects. When Windows was in charge of a project that runs in Linux, Windows and the distro disagreed about who could start its chats, so chats were refused.
The alternative was to keep these as Windows projects and start each chat from Windows through a WSL wrapper. That keeps the split in place: the same project would have two possible owners. It would also need a second launch path for every agent. Reusing the existing server setup removes the split with no new kind of project.
Known limits and follow-ups
Temporary: if the desktop’s saved distro list is out of date, re-adding a project can still race an earlier removal; tracked in STA-12331.
Temporary: if the reply to creating a group is lost during a WSL nested import, retrying can leave an extra empty group; tracked in STA-12331.
Temporary: adding the same new WSL folder twice at the same moment can save it twice; tracked in STA-12331.
Intended: with WSL hosts turned on, adding a new WSL 1 folder is refused with guidance. Saved projects keep working. WSL 1 support ends under the decision recorded in fix(wsl-host): tell users how to fix a distro Orca can't host (D1c-1) #33085.
Temporary: importing one group that mixes already-saved Windows projects with new WSL ones is refused before anything changes, with a message to import them separately. This goes away once saved Windows projects can be moved onto their distro, tracked in WSL mover - move driver runs a WSL move end to end (stacked on D1b-8) #31417.
Temporary: creating a new workspace together with a chat keeps today's order (the workspace is set up first, then the chat starts). That ordering applies to every kind of project and is tracked in STA-11252.
Temporary: WSL projects on a Windows drive (such as
C:\…opened from WSL) keep their current behavior, tracked in feat(wsl): run Git for Windows for a WSL project on a Windows drive (D1c-2) #33090.Temporary: other spellings of the same WSL path that Orca doesn't recognize today are tracked in STA-11388.
Intended: cloning a repository into a WSL folder still clones the way it does today. Cloning on the distro is separate work.
Intended: a Windows Orca server running without the desktop app refuses to add new WSL projects and says to use the desktop app. Setting up a distro's server is done by the desktop app (where it's set up, where adding refuses without it).
Intended: WSL hosts stay behind the existing internal setting. Turning them on for everyone is a separate decision.
Related: #28136 (agent launches in folder projects) and #28697 (finding agents in multi-repository folders).
Linked Issue
None (maintainer PR).
Visual Proof
The refusal for a mixed group import:
Screenshots for every flow tested, next to the same flow on the release build, are in the review status comment.
Testing
Tested for real on Windows 11 with WSL (Ubuntu), using real Claude and Codex:
Test limits: the Windows folder picker itself was not operated (test agents can't use system dialogs). Adding a folder used the same picker substitute as Orca's automated tests, followed by the real button and everything after it. The desktop app used the reviewed build. A compatible older CI-built WSL server was deliberately retained for the mixed-version checks; its exact provenance is in the review status comment.
CI is green on
2eaaf24152f(47 successful checks and 25 skipped), including typecheck, real WSL terminal checks and old/new version compatibility checks. The necessary main integrations and the removal/re-add ordering correction passed focused tests and independent review. The audit’s targeted Add and nested-import checks passed. The drive-UNC Git Create correction passed source review, its failed-before regression and real Windows QA onab664e4456e, carried across the reviewed main merges: the new Git project kept Windows ownership and the original UNC path, with one initial commit and a clean working tree. The full result and evidence are in the review status comment.Agent skill upstream boundary
Author: @BrennanKB5