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(runtime): let paired phones add, clone and create projects on their computer - #51811
A phone paired to a computer could see that computer's projects but couldn't add one. This lets the computer accept "add this folder", "clone this URL" and "create a repository" from a paired phone, using the same rules it already uses for the desktop app.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
7
$\color{#1a7f37}{\Huge{\mathbf{+}}}$80
$\color{#cf222e}{\Huge{\mathbf{−}}}$22
$\color{#1a7f37}{\Huge{\mathbf{+}}}$58
What Changed
Before: the phone's method allowlist (runtime-rpc-mobile-method-routing.ts, the only gate for phone calls) had no repo.add, repo.clone, repo.create, repo.checkCloneTarget, repo.defaultCreateParent or folderWorkspace.create. A phone asking for any of them got "not available to mobile clients".
After:
Those six methods are admitted on the execution-host route, so a call tagged for a runtime: server (an orca serve host or an SSH-managed orcad) is relayed to that server and runs there, as other workspace calls do.
The project methods move out of the crowded routing table into runtime-rpc-mobile-project-methods.ts, along with the existing project reads. The table drops below its line cap instead of the cap being raised.
Hosts publish mobile.project-admission.v1 so the phone shows Add project only where the host (and, for a relayed server, the paired computer too) takes it.
files.browseServerDir takes an opt-in markGitRepos. With it, each folder entry and the listed folder carry isGitRepo (an lstat of .git, 16 at a time), so the phone can show Git folders before opening them. Without it nothing changes; older hosts strip the field.
Why
Every rule the phone needs already lives on the host and runs the same on a desktop, a server and an SSH-managed host: the clone folder name from the URL, taken-folder detection, create-name validation, the default parent folder, dedupe and the Windows-drive refusal on WSL hosts. Admitting the host's own methods keeps one source of truth. A phone-only "add project" call, or copying the desktop dialog's rules into the phone, would have made a second copy that drifts.
The phone already has worktree.create, terminal.create and the file methods on the same workspace permission, so these grant nothing new in kind. Admitting folderWorkspace.create also admits agent.launch's create-folder-workspace target, which is what the phone uses to start an agent in a group's folder workspace.
The git marker is opt-in because the desktop's server-path browser doesn't use it and shouldn't pay for the extra stats.
N/A. Nothing visible changes in this PR. The phone UI that uses these methods is in the next PR, with captures.
Testing
Ran a worktree-built orca serve and paired a phone (iOS simulator, Orca 0.0.71 OTA shell) to it. From the phone I added a Git folder, added a plain folder, cloned github.com/octocat/Hello-World, created a repository, started a workspace in the clone, and created a project group's folder workspace with an agent. All went through these methods on the host.
files.browseServerDir with markGitRepos marked the four fixture repositories and left plain folders unmarked.
pnpm tc:node; pnpm check:changed (45 checks) passes on the stack.
Not run: an SSH-managed orcad host and a Windows host. Both answer the same handlers through the same routing.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No new test here: the routing table is a list of names, and the git marker is an advisory hint that repo.add re-validates.
Performance
None for existing callers: markGitRepos is off unless asked, so the desktop browser and bot import pay nothing new. When the phone asks, one folder listing costs one extra lstat per directory entry plus one for the folder, at most 16 at a time, once per folder the user opens. The new allowlist entries add no work until a phone calls them.
Risk
The riskiest part is widening what a paired phone may do: it can now register, clone and create projects on its computer. That is within what the phone could already do (create worktrees, run terminals), and every call runs through the host's existing validation. An older phone sees no change. An older host refuses these calls, and the phone hides the feature there by the capability. A plain revert removes the methods; projects already added stay added, as they would from the desktop.
Level: Low
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
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
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)
I stated the risk: what could break, for whom, and how to back it out
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.
Walkthrough
Directory browsing can optionally mark entries and the browsed directory as Git repositories. The RPC contract and forwarding path pass the marking option to the runtime. Mobile project RPC methods are listed in a shared tuple and included in execution-host routing. The mobile runtime capability list adds a project-admission capability.
Merge Risk: Moderate · up to d974c
The new project methods for adding a folder, cloning and creating a repository may act on the paired desktop instead of an SSH-managed host the phone targeted. SSH hosts were not tested and no tests were added. The folder or clone could land on the wrong machine, so confirm or restrict SSH-targeted behavior before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: paired phones can add, clone, and create projects on the host computer. The changeset admits the repo.add, repo.clone, repo.create, and folderWorkspace.create RPC meth…
Description check
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof (N/A with reason), Testing, Performance, Risk with level, Agent skill boundary, Notes, …
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: Title check
Explanation
The title names the main change: paired phones can add, clone, and create projects on the host computer. The changeset admits the repo.add, repo.clone, repo.create, and folderWorkspace.create RPC methods for mobile clients, and the title's 'feat(runtime)' scope matches the runtime routing edits. The title is 81 characters, slightly above a typical short title length, but it is specific and clear.
Full details: Description check
Explanation
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof (N/A with reason), Testing, Performance, Risk with level, Agent skill boundary, Notes, and Checklist. It explains the before and after behavior, the mechanism, the rationale, and the rollback path. Minor gaps: the 'AI Disclosure' and 'Review' sections are empty, and the Linked Issue uses 'Part of' references rather than a 'Fixes #' line, which the template asks for from outside contributors. The author is likely a maintainer, so this is not a blocking gap.
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.
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.
Major · Data Integrity & Integration · Heavy lift
Pass the target execution host into repo.add. Do not register SSH-targeted folders locally.
For an ssh execution host, repo.add calls addRepo with undefined as the host argument. The folder is then registered on the local runtime, not on the host the phone named. The method is admitted for this route, so the phone can trigger the mismatch. Route the target host through to addRepo, or refuse repo.add for SSH targets and direct the phone to repo.addRemote.
Phones could only list projects; the host's own add, clone, create and
folder-workspace RPCs were never on the phone allowlist. Admit them on the
execution-host route, publish mobile.project-admission.v1 so phones show the
entry only where the host takes it, and let files.browseServerDir mark Git
folders when asked.
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
A phone paired to a computer could see that computer's projects but couldn't add one. This lets the computer accept "add this folder", "clone this URL" and "create a repository" from a paired phone, using the same rules it already uses for the desktop app.
What Changed
runtime-rpc-mobile-method-routing.ts, the only gate for phone calls) had norepo.add,repo.clone,repo.create,repo.checkCloneTarget,repo.defaultCreateParentorfolderWorkspace.create. A phone asking for any of them got "not available to mobile clients".runtime:server (anorca servehost or an SSH-managed orcad) is relayed to that server and runs there, as other workspace calls do.runtime-rpc-mobile-project-methods.ts, along with the existing project reads. The table drops below its line cap instead of the cap being raised.mobile.project-admission.v1so the phone shows Add project only where the host (and, for a relayed server, the paired computer too) takes it.files.browseServerDirtakes an opt-inmarkGitRepos. With it, each folder entry and the listed folder carryisGitRepo(anlstatof.git, 16 at a time), so the phone can show Git folders before opening them. Without it nothing changes; older hosts strip the field.Why
Every rule the phone needs already lives on the host and runs the same on a desktop, a server and an SSH-managed host: the clone folder name from the URL, taken-folder detection, create-name validation, the default parent folder, dedupe and the Windows-drive refusal on WSL hosts. Admitting the host's own methods keeps one source of truth. A phone-only "add project" call, or copying the desktop dialog's rules into the phone, would have made a second copy that drifts.
The phone already has
worktree.create,terminal.createand the file methods on the sameworkspacepermission, so these grant nothing new in kind. AdmittingfolderWorkspace.createalso admitsagent.launch'screate-folder-workspacetarget, which is what the phone uses to start an agent in a group's folder workspace.The git marker is opt-in because the desktop's server-path browser doesn't use it and shouldn't pay for the extra stats.
Linked Issue
Part of #24018, #21669, #28638, #13848, #41686, #9653, #38112 and #42773. This PR is the host half: the phone screens land in the PRs stacked on it.
Visual Proof
N/A. Nothing visible changes in this PR. The phone UI that uses these methods is in the next PR, with captures.
Testing
Ran a worktree-built
orca serveand paired a phone (iOS simulator, Orca 0.0.71 OTA shell) to it. From the phone I added a Git folder, added a plain folder, clonedgithub.com/octocat/Hello-World, created a repository, started a workspace in the clone, and created a project group's folder workspace with an agent. All went through these methods on the host.files.browseServerDirwithmarkGitReposmarked the four fixture repositories and left plain folders unmarked.pnpm tc:node;pnpm check:changed(45 checks) passes on the stack.Not run: an SSH-managed orcad host and a Windows host. Both answer the same handlers through the same routing.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
No new test here: the routing table is a list of names, and the git marker is an advisory hint that
repo.addre-validates.Performance
None for existing callers:
markGitReposis off unless asked, so the desktop browser and bot import pay nothing new. When the phone asks, one folder listing costs one extralstatper directory entry plus one for the folder, at most 16 at a time, once per folder the user opens. The new allowlist entries add no work until a phone calls them.Risk
The riskiest part is widening what a paired phone may do: it can now register, clone and create projects on its computer. That is within what the phone could already do (create worktrees, run terminals), and every call runs through the host's existing validation. An older phone sees no change. An older host refuses these calls, and the phone hides the feature there by the capability. A plain revert removes the methods; projects already added stay added, as they would from the desktop.
Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)