Skip to content

feat(mobile): show and use the desktop's server workspaces on the phone - #26501

Merged
Jinwoo-H merged 66 commits into
mainfrom
feat/mobile-remote-workspaces
Oct 14, 2026
Merged

Jinwoo-H merged 66 commits into
mainfrom
feat/mobile-remote-workspaces

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1774 $\color{#cf222e}{\Huge{\mathbf{−}}}$​89 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1685
Prod 86 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2114 $\color{#cf222e}{\Huge{\mathbf{−}}}$​968 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1146

ELI5

A phone paired with a desktop now shows the workspaces on the Orca servers that desktop is connected to,
not just the desktop's own and SSH workspaces. You can open them and use them from the phone, and every
request goes through the desktop. Each server's badge shows its health, for example "Update needed" or
"Disconnected", the same way the desktop does.

Base: main. The desktop's server list (#26442) and the e2e harness (#26412) have both merged, so
this diff is only this PR.

Stack and merge order.

  1. feat(mobile): show and use the desktop's server workspaces on the phone #26501 (server workspaces on the phone) merges first.
  2. Then fix(mobile): check a server workspace's SSH state on that server #26519, test(mobile): prove server browsers reach a paired phone through the desktop #26521, feat(mobile): create workspaces on the desktop's servers from the phone #26533 and feat(notifications): open a server agent's notification on its server #26518, each stacked on feat(mobile): show and use the desktop's server workspaces on the phone #26501.
  3. Then feat(mobile): offer a server's SSH repos on the New Workspace sheet #27728 (needs fix(mobile): check a server workspace's SSH state on that server #26519 and feat(mobile): create workspaces on the desktop's servers from the phone #26533) and feat(mobile): view and drive server browser pages the desktop renders #27749 (needs feat(mobile): show and use the desktop's server workspaces on the phone #26501).
  4. Then feat(mobile): list the desktop's server projects on the phone's Tasks screen #27741 (needs feat(mobile): offer a server's SSH repos on the New Workspace sheet #27728).

Phones need the new native app release before server workspaces open. Until then, opening one shows
the existing screen "Your phone can't reach this workspace's server through this desktop."

What Changed

Before: a phone paired with a desktop never showed workspaces from the remote Orca servers that desktop
connects to.

After:

  • Listing. The phone lists every server workspace the desktop shows, fetched through the desktop
    (mobileRelay.hosts.list / .worktrees).

    • The host badge adds the server's health using the desktop's labels.
    • While a server can't be reached, the desktop keeps serving its last rows and the phone keeps showing
      them under that server's health badge. A server the desktop stops listing
      loses its rows.
    • The phone shows exactly the hosts the desktop's sidebar shows (visibleWorkspaceHostIds).
  • One shared server-list feed. The host list and every open server workspace read the desktop's
    server list from one feed per desktop connection (relay-hosts-feed.ts), polled every 3 seconds only
    while something is reading it and the app is in the foreground. The next read is scheduled from when
    the last one finished, so a slow reply can't stop the polling. A reply from before a disconnect is
    thrown away, so an old answer never lands on a new connection.

  • A server workspace's connection state. A server workspace no longer borrows the desktop's
    green dot. It reads:

    • connected only when the desktop can relay to that server now;
    • connecting while the desktop is reconnecting to the server, or has reached it but is still waiting
      for its status, matching the desktop's reconnecting banner;
    • disconnected when the server is too old to relay to, the desktop reports it failed, or it is no
      longer listed.

    It reuses the phone's existing connecting and disconnected screens, and reloads the tabs when the
    server comes back. Before this, a stopped server kept a green dot and "Loading tabs" spun forever.

  • Using a server workspace. Every screen in a server workspace sends its calls to that server through
    the desktop: terminal, files, source control, diff, preview and agent history.

    • The target is set once, at the workspace route (WorkspaceRoute / useWorkspaceClient), so screens
      never choose one themselves.
    • Feature gates read the server's own status.get, not the desktop's.
    • Pinning a server workspace writes to that server.
  • Old servers and unreachable servers.

    • Tapping a row on a server that needs an update shows the existing notice banner: "Update Orca on
      to open its workspaces from your phone."
    • If the phone can't reach a server through this desktop (an older app or desktop, or an unreadable
      status), the workspace shows the existing "unavailable" screen with "Your phone can't reach this
      workspace's server through this desktop." The phone never quietly falls back to the desktop.
  • Wire.

    • The phone names the server with an executionHost field. It travels in the general-purpose
      request envelope from feat(mobile): let the OTA page send extra top-level request fields #27815, which every transport (direct, cloud relay, shell bridge) already
      copies onto the wire request, including stream replays and unsubscribes. On the wire the field
      still sits at the top level of the request, as before.
    • Server rows appear only when the phone can actually reach them: the desktop advertises the relay
      capability AND the transport carries an envelope. The native app always does. A page does only
      when its shell grants rpcEnvelope. Under an older app, the page shows exactly today's list, with
      no server rows and no server-list call.
    • The desktop now advertises the relay capability, and routes a targeted status.get to the server.
    • The server workspace list drops its unread stale, fetchedAt, totalCount and truncated
      fields; the phone reads only the rows, and reads reachability from the server list.
  • Badge width. The cap moved from the whole badge to the host name, so "· Update needed" stays
    readable.

  • Housekeeping.

    • Adding the capability pushed protocol-version.ts over its 300-line cap. The two relay capabilities
      are one group in mobile-desktop-relay-contract.ts, and the account capabilities moved to
      src/shared/account-runtime-capabilities.ts, as the file's other groups already do. Same strings,
      same order.
    • The mobile page's script-count budget was re-measured for the new workspace modules: 79 scripts at
      16 routes.

Why

The phone is meant to mirror its paired desktop, including servers. Setting the target once per
workspace route, rather than per call, keeps screens unaware of where they run. The desktop stays the
only reader of the routing table, so a phone and a desktop on different versions still agree. One feed
for the server list means the badge and the open workspace can't disagree, and the desktop is asked
once per tick, not once per screen.

Rejected alternatives:

  • putting the target inside request params, which would avoid an app release but fork the relay contract;
  • copying the routing table into the phone, which drifts when phone and desktop update separately;
  • listing servers through the relay plus a cache, which means two listing paths;
  • each screen polling the server list itself, which doubles the desktop's load and lets screens disagree.

Linked Issue

N/A (maintainer)

Visual Proof

server-rows.png

This is a react-native-web render of the phone's list with stand-in icons, not a device capture. It shows
the update-needed notice, a server that needs an update, and a disconnected server with a long name.
The stack was also verified on an Android emulator against a real desktop and server.

Testing

  • Automated tests added/updated, or explained why not below

  • End to end (tests/e2e/paired-mobile-desktop-mirror.spec.ts) runs a real desktop, a real server
    and an encrypted phone client. The phone:

    • lists the server workspace through the desktop;
    • opens a server terminal and gets the computed output of echo X_$((1000+7));
    • reads the server's files (files.readDir) and git status (git.status), while the same calls
      without a target fail on the desktop;
    • while the server is stopped, sees it reported as reconnecting and not relaying, still gets its last
      rows, and server calls return remote_runtime_unavailable;
    • after a restart, sees it relaying again and lists and works again.
      Removing the target from the phone's requests fails the test. Keystroke echo on one quiet machine was
      about 7 ms relayed against 6.5 ms direct.
  • Unit and wiring tests:

    • the target on every transport (direct, cloud relay, bridge, replay, unsubscribe);
    • the envelope gate: a page under a shell without rpcEnvelope lists no server rows and makes no
      server-list call, and the same page with the grant lists them;
    • a census that renders all 14 workspace route files (native and web) and checks each passes the
      server down;
    • no desktop fallback;
    • the unreachable screen;
    • the connection state (connected, connecting, disconnected) and the shared feed (one read for two
      readers, polling past a slow read, discarding a reply from before a disconnect);
    • server feature gates;
    • pinning on the server;
    • hidden hosts;
    • old desktop and old shell showing today's view.
  • Relay integration: a targeted status.get returns the server's runtime and capabilities.

  • Recorded RPC goldens: 8 re-recorded with the recorder. The wire frames are byte-identical; only
    recorded screen state gains an empty server list and visibleHostIds: null.

Notes

… specs

Later phone-mirror slices need one oracle that drives a real mobile-scoped device with the
phone's own capabilities against a serve host or a paired desktop. Pins #26022 across a serve
restart and today's gap: a desktop's phone does not list the desktop's server workspaces.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Rows on an SSH host the desktop cannot reach looked healthy on the phone. The badge now
adds the desktop sidebar's own word ("devbox · Disconnected"), derived by the same shared
function from the connection status ssh.listTargetSummaries already sends; old desktops keep today's badge.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Slices need one composer for host, desktop and phone with a single teardown, so specs stop
copying setup. The serve-restart spec now reads the first tab-stream snapshot after the cold
start, which is what the phone builds its tab strip from.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The desktop card shows SSH status on any host count, so the phone now reads target summaries
whenever a repo is on SSH and badges an unhealthy host alone too. Labels and health share one
target-to-host keying, and a hook-level test pins the reply-to-row wiring.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Teardown failures become a test attachment instead of replacing the real failure, and the
cold-snapshot poll reports stream errors together with the PTY list.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…e dot

A catalog that no longer spans hosts or holds an SSH repo now clears the health and label maps,
so a host that left cannot keep badging rows. The badge gets a screen-reader label ("devbox,
Disconnected") instead of reading the middle dot.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…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
…h the desktop

A phone mirrors its desktop, including workspaces on the desktop's configured servers. The desktop
now forwards a request that names `executionHost: runtime:<env>` to that server over one socket per
(phone, server), signed in as the phone's delegated device; replies pass through untouched except
stream ids. Hidden until the phone client ships: the relay capability is not advertised yet.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… tsc passes

Fixtures hoisted into consts widened their health maps to string, which the now-required
hostHealthById rejects under the tests-typecheck ratchet; passing them inline keeps the union.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…p-mobile-relay

Takes S1a's contract file verbatim (plural capability name) and moves the unpair re-sync into its
RuntimeRpcMobileDevices; the relay integration test now syncs against the real server.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
main dropped docs/reference, so the relay's contract lives beside the code. Also pins that a
server whose delegated sync fails (e.g. delegated_device_revoke_failed) is unavailable until a
later request syncs it again.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The production hosts adapter was only typechecked; this pins that it resolves configured servers
by exact id only (never a name or a removed server), fences by pairing revision and runtime
identity, and stops reporting retirements once unsubscribed.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The settled metadata state now carries hostHealthById, and an SSH-only catalog now reads the
target summaries so a lone unhealthy host can be badged. Scoped re-record via rpc-recording.mts.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Reuses the shared E2EE socket opener, folds relay state into fewer fields, never sends a request
whose link ended while opening, passes failure codes through, relays only this desktop's own
phones, and drops the unused host-state reader until S2 needs one.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Restores the 8 MiB frame cap on every remote runtime socket, re-checks an update-needed server on
each new link so an in-place upgrade relays, answers a phone the server just declined without
syncing again, and ends a link whose mirrored capability update cannot be queued.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The phone tags every call on a workspace screen with its execution host, so a
paired-desktop method carrying `runtime:<env>` now runs locally instead of
failing 'forbidden'. The Mac stays the only reader of the routing table.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…rkspace rows for the phone

The phone needs the same host list the desktop shows, including servers that are offline or
too old to relay to. mobileRelay.hosts.list/worktrees answer from the desktop's own status and
its own worktree.ps fetches, cached per server and fenced by pairing, never from relayed replies.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… side effect on listing

The phone now always lists a server's rows through mobileRelay.hosts.worktrees, so the
desktop's own fetch is both the live source and the cache, and stamping stays in main.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… forget removed servers

The desktop now asks for the phone's full-catalog limit, answers within 5s with the last rows
when a server hangs, drops a server's rows when it is removed or re-paired, and checks the
server's identity after the fetch so a reply from before a re-pair is never served.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
A phone reaches a server's workspace through its desktop only if each call names the host; the
direct, cloud-relay and shell-bridge transports now carry `executionHost`, streams keep it for
replay and unsubscribe, and an older shell (no `executionHost` grant) refuses rather than strips it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…de rows mid-delete

A server Orca manages on an SSH host now lists once under that host's name, or not at all while
the host is reached over the SSH relay, using the sidebar's own folding. Rows the server is
deleting are left out at reply time, as a phone asking the server itself would see.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@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
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2dc72337-d348-4660-889a-7a8c9005d6db
📥 Commits

Reviewing files that changed from the base of the PR and between 4b0728b and 643aaa0.

📒 Files selected for processing (12)
  • config/scripts/verify-mobile-web-app-bundle.mjs
  • mobile/src/mobile-web-shell/mobile-web-shell-agent-history-route.test.tsx
  • mobile/src/mobile-web-shell/mobile-web-shell-files-route.test.tsx
  • mobile/src/mobile-web-shell/mobile-web-shell-session-route.test.tsx
  • mobile/src/mobile-web-shell/shell-switch-build-kind.test.tsx
  • mobile/src/navigation/workspace-route.test.tsx
  • mobile/src/navigation/workspace-route.tsx
  • mobile/src/transport/use-workspace-client.ts
  • mobile/src/transport/workspace-server.ts
  • mobile/src/worktree/relay-hosts-feed.test.ts
  • mobile/src/worktree/relay-hosts-feed.ts
  • tests/e2e/paired-mobile-desktop-mirror.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/scripts/verify-mobile-web-app-bundle.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

… disconnected

A server the desktop has reached but whose status is not answered yet is moments from relaying,
so it reads connecting; a server too old to relay to never will, so it reads disconnected.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
# Conflicts:
#	tests/e2e/helpers/paired-mobile-client.ts
…module

Main's merge put protocol-version.ts at 301 lines, over the 300 cap. The account group moves out
like the relay and skill groups did, same strings in the same order; the page's script sweep is
re-measured because the split changed its chunking (81 to 79 at 16 routes).

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Jinwoo-H and others added 9 commits October 12, 2026 04:05
# Conflicts:
#	mobile/src/mobile-web-shell/bridge-host-init.test.ts
#	mobile/src/mobile-web-shell/bridge-host-native-verbs.test.ts
#	mobile/src/mobile-web-shell/bridge-host-stream-frames.ts
#	mobile/src/mobile-web-shell/bridge-host-subscriptions.ts
#	mobile/src/mobile-web-shell/bridge-host.ts
#	mobile/src/mobile-web-shell/bridge/bridge-client-errors.ts
#	mobile/src/mobile-web-shell/bridge/bridge-client-subscriptions.ts
#	mobile/src/mobile-web-shell/bridge/bridge-envelope.ts
#	mobile/src/mobile-web-shell/bridge/bridge-init-frame.ts
#	mobile/src/mobile-web-shell/bridge/bridge-rpc-client.ts
#	mobile/src/transport/mobile-relay-rpc-session.ts
#	mobile/src/transport/mobile-relay-rpc-streams.ts
#	mobile/src/transport/rpc-client-request-tracker.ts
#	mobile/src/transport/rpc-client-stream-registry.ts
#	mobile/src/transport/rpc-client.ts
#	mobile/src/transport/unvalidated-rpc-request-port.ts
The server name now rides the generic request envelope from #27815 instead of
its own executionHost option, bridge grant and per-transport plumbing. Server
rows show only where the transport carries an envelope (native, or a shell
that grants rpcEnvelope), so an older app keeps today's list.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
A server workspace call still reaches the desktop as the same top-level
executionHost frame, on the direct and relay wires, and a deep link into a
server workspace under an app without rpcEnvelope shows the unreachable screen.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…rder

Equal envelopes name one cleanup slot whatever their key order, the scoped view
passes its client's envelope answer through as it does the generation, and the
direct wire harness is shared instead of rebuilt.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ktop's chat setting

A relayed agent.launch ran on the server, which picked chat vs terminal from its
own setting. The desktop relay now stamps its own default as nativeChatDefault;
new servers use it in place of their setting (feasibility still decides), older
servers strip it. Outside the replay fingerprint.

Co-Authored-By: Claude <[email protected]>
…ts own module

Keeps mobile-desktop-relay.ts under the line limit once #27749's page relay lands on it.

Co-Authored-By: Claude <[email protected]>
…chat default

The early-tab preflight read the server's own chat setting while the launch
used the desktop's stamped nativeChatDefault, so on a windowed server with
chats off a relayed chat launch flashed a terminal tab. Both now read the
settings through readAgentLaunchModeSettings(runtime, nativeChatDefault).
@Jinwoo-H
Jinwoo-H merged commit 5f134d8 into main Oct 14, 2026
52 of 53 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 14, 2026
Jinwoo-H added a commit that referenced this pull request Oct 14, 2026
Jinwoo-H added a commit that referenced this pull request Oct 14, 2026
Jinwoo-H added a commit that referenced this pull request Oct 14, 2026
Jinwoo-H added a commit that referenced this pull request Oct 14, 2026
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