Skip to content

feat(runtime): let paired phones add, clone and create projects on their computer - #51811

Merged
AmoabaKelvin merged 3 commits into
mainfrom
mobile-project-admission-host
Nov 28, 2026
Merged

AmoabaKelvin merged 3 commits into
mainfrom
mobile-project-admission-host

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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.

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.

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 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)

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

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: c3d285fb-37d7-42c9-ae7d-13e83f53ae3a
Commits

Reviewing files that changed from the base of the PR and between 0fd41e5 and d974ce2.

Files selected for processing: 1

  • src/main/runtime/rpc/server/runtime-rpc-mobile-method-routing.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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

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: 79533a72-f4f0-4cfe-b4fc-36d653a991cb
Commits

Reviewing files that changed from the base of the PR and between f44167e and 0fd41e5.

Files selected for processing: 7

  • src/main/runtime/files/server-browse/browse-git-repo-marker.ts
  • src/main/runtime/files/server-browse/runtime-server-environment-commands.ts
  • src/main/runtime/rpc/methods/files/files.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-method-routing.ts
  • src/main/runtime/rpc/server/runtime-rpc-mobile-project-methods.ts
  • src/shared/remote-runtime/protocol/mobile-runtime-capabilities.ts
  • src/shared/rpc-contract/filesystem/files-params.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.

'repo.sparsePresets',
'repo.update',
// Add project from the phone (mobile.project-admission.v1): the host's own add, clone and create rules.
'repo.add',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-project-admission-host branch from 0fd41e5 to d974ce2 Compare November 28, 2026 13:09
@AmoabaKelvin
AmoabaKelvin merged commit 078fa1d into main Nov 28, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant