Repository navigation
fix(windows): use project runtime for folder agent launches - #28136
Draft
brennanb2025 wants to merge 5 commits into
Draft
brennanb2025 wants to merge 5 commits into
brennanb2025 wants to merge 5 commits into
Conversation
This was referenced Oct 15, 2026
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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, an agent in the same folder workspace could run on Windows from + but in WSL from a phone, command-line launch or worker. Host launches treated the folder key as a repository ID, missed its project runtime, and used Terminal shell instead. That could select a different installation, login, tools or WSL distro.
Agent launches in a native-drive folder containing exactly one local project repository now follow that project's explicit Windows choice, explicit WSL distro or inherited global WSL distro. The inherited Windows default keeps its existing behavior while the separate settings decision is pending.
What Changed
These cells apply to host-built agent launches with a native-drive starting directory. “Shell distro” is the distro selected in Terminal shell.
The changed agent paths include terminal-mode AI actions, CLI agent launches, existing-workspace orchestration workers, host-created prompt/model tabs, headless phone launches, phone renderer handoff and rescue, and pending phone-tab rebuilds. New canonical folders use the same agent paths. Existing renderer-selected terminals, repository workspaces, their automation/new-worktree startups, and supported native chat retain their runtime selection.
Paired-client resumes stay on the existing host-owned session path: the host builds and quotes the resume for the folder's chosen shell, carries that shell into the terminal, and retains the existing session claim that prevents duplicate ownership. A successful host resume uses only the host-built command. The claim remains the same path-based kind used for repository workspaces; this adds no execution-namespace attestation.
If the host cannot use its existing session claim, such as with an older terminal daemon, the paired client still falls back to its own quoted command. That fallback now starts in the folder project's runtime shell, so client quoting can disagree with the selected shell; this known edge is disclosed without adding another launch guard.
The existing runtime resolver opts agent callers into folder project resolution. Both renderer and host now use one folder ownership lookup in the existing shared execution-host module. Existing shell channels carry command and shell together, including a WSL-share startup cwd. A project that needs repair fails with the existing Settings advice to choose an installed WSL distro, switch to Windows or repair WSL. This also changes the error text for repository terminals, including +: instead of saying the project runtime requires repair before a terminal can start, the error explains which setting to change or how to repair WSL.
Orchestration now reads command overrides using the folder project's launch shell, and its OpenCode model pre-check uses the same folder runtime as the launch. OpenCode with a picked model retains the existing refusal when the chosen runtime is WSL; this adds no WSL model-verification capability. No settings, wire fields, opcodes or process-launch APIs are added.
Unchanged on purpose
orca terminal create --shellrequests keep their existing behavior and are not newly refused because of the folder's project runtime.Follow-up: broader alignment of non-agent folder terminals, browser networking and skill discovery/install belongs in separate scoped work.
The full PR is 26 files, +1175/−65 lines: production and shipped catalog +222/−54; tests/fixtures +953/−11. Round 2 is 13 files, +94/−46; no reports or documentation are committed.
Why
Sharing folder ownership and reusing the runtime and shell resolvers fixes the missing project lookup without another launch planner. Limiting the opt-in to agent callers avoids changing user-authored shell commands or refusing previously allowed non-agent shell requests. Keeping resume quoting and claims on the host avoids sending client-quoted arguments into a different shell.
The inherited Windows default stays unchanged because saved data cannot distinguish a deliberate global Windows choice from the shipped default. This PR does not make that product decision.
Linked Issue
STA-10231
Visual Proof
Windows live QA is deferred until code review, as requested. Settings-UI-only QA rows are recorded outside the repository. No desktop application or simulator was launched.
Testing
tc-gate pnpm tc:nodeandtc-gate pnpm tc:webpass.orca-ci-checks --no-typecheckpasses all 23 checks with the ignored worktree Bun 1.4.3 install.The paired-resume tests exercise the real paired-client RPC handler, runtime, claim and provider. They assert the host-built resume reaches the terminal with its selected shell and claim, with one spawn and no legacy fallback; they do not mount a real paired-client transport. All evidence is source and mocked-provider testing on macOS, not live Windows/SSH/mobile execution.
Review
Draft only; no merge or main sync. C1 #27692 should use
findLocalFolderWorkspaceProjectfrom the shared folder execution-host module too, and consolidate these shell inputs into its existing runtime fact. Its inherited-Windows exception remains until STA-10231's settings decision. Integration must retain the existing WSL OpenCode model refusal.Follow-ups
Agent skill upstream boundary
Notes
The execution host owns resolution. SSH/paired-server folders cannot borrow a local project; ambiguous folders do not choose one. Existing mixed-version behavior and optional shell channels remain compatible.
Checklist
Author: @BrennanKB5