Repository navigation
feat(runtime): let a paired desktop register its phones as phone devices - #26427
Conversation
…mobile devices A desktop paired to this runtime can now call pairing.delegatedMobileDevice.sync to make each of its phones an ordinary mobile-scope device it owns, so the phone mirrors that host through the desktop. Children are never pending, inherit the parent's reach, and die with the parent's grant. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…atch Dispatch binds the caller-bound delegated-device context, so the revoke path it needs now lives in a layer under it as a pure move; this drops the abstract method seam. No behaviour change. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…oked A failed child cleanup now leaves the parent in place so a retry can still find the children, and revokeRuntimeAccess lives beside the revoke it cascades to. Adds restart, rename and bounds coverage, shares credential minting, and drops the timing-dependent census. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…oked Matches the parent revoke: a child whose cleanup could not be saved is kept and the sync errors before minting anything, so the desktop retries instead of believing the server matches its list. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⛔ Files ignored due to path filters (1)
⚙️ Run configuration
⛔ Files ignored due to path filters (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Delegated phones can be saved with blank display names. Reject or normalize those names before merging, or accept this limited risk as a follow-up. Pre-merge checks |
|
…d-mobile-devices Conflicts resolved: keep both capability lists and DeviceEntry fields; take main's rpcContextFromTransport and add delegatedMobileDevices to it; drop the revoke methods main kept in runtime-rpc-pairing (this branch moved them). The sync method declares main's new required permission as 'workspace', since paired desktops never hold pairing-admin. Grant and relay-binding row validation moves to its own file so device-registry stays under max-lines. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a5cf522c-1a47-4476-8951-8f93a230a087
⛔ Files ignored due to path filters (1)
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (8)
src/main/runtime/device-registry-row-validation.tssrc/main/runtime/device-registry.tssrc/main/runtime/rpc/core.tssrc/main/runtime/rpc/dispatcher-stream-options.tssrc/main/runtime/rpc/methods/pairing.tssrc/main/runtime/runtime-rpc/runtime-rpc-pairing.tssrc/main/runtime/runtime-rpc/runtime-rpc-websocket-dispatch.tssrc/shared/protocol-version.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| parent: DeviceEntry, | ||
| phones: readonly DelegatedPhone[] | ||
| ): DelegatedMobileDeviceEntry[] { | ||
| const { nextDevices, entries } = planDelegatedMobileDevices(this.devices, parent, phones) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject blank delegated-device names in the registry.
If a desktop sends name: ' ', the RPC schema accepts it and planDelegatedMobileDevices persists it unchanged. Validate and trim names before this registry operation saves new or renamed children. This prevents blank names in the paired-device list. (raw.githubusercontent.com)
Based on learnings: “name validation and normalization (trimming, rejecting blank/whitespace-only) must happen inside the storage layer itself.”
Source: Learnings
…ed desktop A delegated child phone could call the mobile-allowlisted pairing-admin methods (push registration, relay provisioning) that its parent desktop is never granted. The caller scope now marks delegated phones and denies them that permission. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
ELI5
A desktop connected to an Orca server can now register its paired phones on that server as ordinary
phones. Nothing uses this yet. It's the one server change needed so a phone can later reach the
desktop's remote server workspaces through the desktop, with the server treating each phone exactly
like a phone that paired with it directly.
What Changed
Before: a server only knew the devices that paired with it directly. A desktop relaying a phone's
requests could only send them as itself, so two phones looked like one client and lost phone-specific
handling: terminal seats, clipboard ownership, chat size limits, cleanup.
After:
pairing.delegatedMobileDevice.sync.{ phones: [{ phoneKey, name }] }, at most 32 phones, with keys and names of 1–128 characters.{ devices: [{ phoneKey, deviceId, token }] }.phoneKey. Children the caller no longer lists are revoked through the normal phone revoke path.They inherit the desktop's pairing reach, so the server never binds more widely.
a retry still reaches it. A sync that can't revoke a dropped phone fails instead of reporting success.
pairing.delegated-mobile-devices.v1is advertised, so a desktop can detect support.(
runtime-rpc-mobile-devices.ts) below the request dispatch layer. Dispatch then gives the handler acaller-bound
delegatedMobileDevices.sync, the same way it already gives the relay pairing calls theircaller. A shared
mintDeviceCredential()mints tokens for both paths.Why
Making each phone a real phone device on the server reuses everything the server already does for
phones, and no request handler changes. The rejected alternative taught the server a new "viewer acting
for a desktop" identity, which would have needed plumbing across several identity fields and request
params. One sync call that names the full phone list is simpler than separate add, remove and list
requests: the desktop holds tokens only in memory and re-syncs on connect, so nothing needs cleanup on
the desktop.
Linked Issue
N/A (maintainer)
Visual Proof
N/A. Server-side only; nothing calls it yet.
Testing
delegated-mobile-device.integration.test.tsuses the real dispatch, the encrypted client and theregistry. It has 12 tests:
phoneKeyand the 32-phone limit;Each protection was checked by breaking it on purpose: its test fails. The related suites pass:
133 tests across 19 files on the reviewer's run, and 501 across 65 files on the lane's.
Notes
paired-devices list doesn't stick, because the desktop's next sync re-creates it. Unpair the phone from
the desktop to remove it everywhere.
ordinary standalone devices that revoking the desktop no longer removes. After upgrading again, the
next sync creates fresh ones, and the old ones remain until revoked by hand. An older server also
doesn't advertise the capability, so desktops stop syncing to it.
the phone allowlist. Tokens appear only in the encrypted reply.