Repository navigation
fix(mobile): detect New Workspace agents in the selected repo runtime - #31351
Conversation
Pass the source repo to both New Workspace detection paths before a worktree exists. Resolve its owning host and project runtime with the existing host-side workspace logic, including WSL paths and Windows project preferences. Retain host-default requests for old clients, SSH routing, and ambiguity refusals. Clear the modal agent results when switching source repos. Inspired by the New Workspace follow-up in community PR #20101, adapted to the current host-authoritative detection contract. Co-authored-by: welldoingk <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 4 minutes. View limit details
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. Comment |
|
Adversarial follow-up found a new repo-target boundary to tighten before merge: malformed repository ownership metadata can normalize to local when the repo route synthesizes hostId. The focused fix will let the existing strict ownership lookup validate the stored row and refuse malformed owners. Reproduction and additional host/repository switch races are being validated. Temporarily marked draft until the amendment is reviewed and pushed. |
Current risk review
Merge risk: Low. The earlier controlled catalog/selector boundary is now closed. At this exact head, the real Store + ProfileStateSqliteAuthority flush/close/reopen a SQLite catalog and feed the full OrcaRuntimeService, protected selector, request schema, RPC handler and detector on native Windows Node v24.18.0 / actual Ubuntu. Native repo detects
claude, codex, opencode, omp, prime-agent, droid, grok; selected WSL repo detectsclaude, prime-agent, kimiand excludes mounted Windows commands. UNC git and folder targets resolve Ubuntu despite a persisted Windows-host default. Untrusted path/distro/host hints are stripped. A persisted owner change during lookup refusesrepo_target_changed; later lookup and another SQLite reopen refuse the foreign runtime. Unknown IDs refuse; legacy untargeted calls stay local. The same full persisted-runtime fixture passes the non-Windows branch on macOS. The 4,749-module exact-source bundle hash and exit 0 are verified on Windows; owned profiles/directories/PTYS were removed/closed. This supports lowering risk from low–medium to low. Electron process APIs are fixture-stubbed; the patched shared service was not deployed/restarted. Older installed hosts safely accept additiverepoIdbut need an update for selected-WSL parity.All five remaining exact heads combine cleanly on reviewed main
d15677e334b01d345266b387252f68b47f35f038asa604c0599c29bb6e108156edb8381676a0cee889. 519 mobile tests / 37 files and 194 desktop tests / 8 files pass, including upstream reading-place, async prompt/send and paste-drop coverage; full mobile lint, production types (1,883 roots) and the unchanged 118-file test diagnostic baseline (2,989 roots, no additions/stale entries) pass. Production bundle integrity/reproducibility/size pass (130 assets; 8,607,138/9,437,184 budgeted bytes). This uses existing installed dependencies: newer-main dependency upgrades were not installed. The committed WebView declaration patch is applied only in compiler memory. Exact head CI and aggregate gate pass; skipped jobs remain separate. No product code/head or shared service/dependency changed in this pass. All manual work remains together at the end.ELI5
When you choose a repository inside WSL on your phone, Orca should look for agents inside that repository’s Linux environment. New Workspace instead asked Windows which agents it had. Both workspace creation screens now name the selected repository so its host can look in the right place.
What Changed
Why
A workspace does not exist yet during creation, but the source repo already does. Using its host-owned record preserves project runtime preferences, remote ownership checks, and the existing WSL parser.
This follows the New Workspace investigation in community PR #20101 by @welldoingk, adapted to the current host-resolved contract. The commit includes
Co-authored-by: welldoingk <[email protected]>.Linked Issue
Fixes #20060
Visual Proof
Source-built Release iPad simulator, current production hosted web shell, production E2EEv2 transport. Same fixture/server key and selected WSL repository; only the production web bundle changes between sessions. Every screenshot below was visually inspected.
Only OpenCode is enabled in the isolated fixture settings. The actual Windows host PATH lacks it, while the actual Ubuntu-24.04 WSL repository has it. Before: Blank Terminal only. After: OpenCode is available and selected by default in both workspace creation flows.
Validation boundary: the live
awinhost predates this change, so a fixture adapter translates the new knownrepoIdto that repository’s existingworktreeIdfor real WSL agent detection. Baseline requests omit the target and probe the real Windows PATH. Host unit tests independently verify the new repository resolver; this does not claim the host patch is deployed toawin. No workspace was created.Testing
awin, Ubuntu-24.04: WSL agent detection differs from Windows PATH. An older host accepts the new optional repo field, ignores it, and retains its existing behavior.Mobile application typecheck, the 1,064-file mobile test-typecheck ratchet, the 17,241-file host application/test typecheck, changed-code quality, and formatting pass. Full applicable lint/build/test CI and aggregate gate now pass at the exact final head.
Review
Root independently reviewed the host-resolution extraction and repo target reuse. A second adversarial boundary review found a malformed stored owner could normalize to a local probe; removing the synthesized owner restores the shared strict resolver’s refusal. Root accepted that minimal fix, and its before/after regressions pass. A later timing review added a narrow post-await snapshot check for the new repository target. Existing shell detection is asynchronous; this check guarantees a consistent target at host resolution and does not lock repository settings throughout an external probe or launch. SSH continues using its existing request. Existing worktree/folder-workspace resolution and no-target requests retain their behavior. The optional field is stripped by current older schemas, and oldest no-param hosts discard request params. Host records resolve paths, project preferences, and ownership; the phone cannot inject a distro or shell command.
Agent skill upstream boundary
Notes
Platform-specific runtime selection stays in the existing host resolver. macOS, Linux, Windows, folder workspaces, and paired hosts continue using that shared resolution.
Checklist
Additional exact-head platform validation on real Windows/Ubuntu uses the production resolver, request schema, RPC method and detector at
06fd6864e695. Native Windows returns seven agents; the selected Ubuntu repo returnsclaude,prime-agent, andkimi, excluding Windows-mounted Codex/OpenCode commands. Deletion/path/owner/connection/duplicate mutations across the selector await and malformed/foreign/unserved owners refuse. Five production source hashes match Git. The catalog and selector are controlled fixture boundaries; this does not claim a patched service deployment. A separate live older-runtime probe safely accepts the additive parameter but retains its Windows-default list, so selected-WSL parity still needs a host update. Owned temp files and the test terminal were removed; shared services/dependencies were untouched.