Skip to content

feat(notifications): open a server agent's notification on its server - #26518

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

Jinwoo-H merged 90 commits into
mainfrom
feat/mobile-remote-notifications

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​100 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​100
Prod 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​64 $\color{#cf222e}{\Huge{\mathbf{−}}}$​25 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​39

ELI5

Tapping a phone notification about an agent running on one of the desktop's Orca servers now opens that
workspace on the server. Before, the tap opened it on the desktop, which bounced back with "That workspace
no longer exists on this host."

Stacked on #26501. Review only this branch's own commits.

Needs the push service from #26516 in production first: done. #26516 was deployed to production on
2026-10-12 and verified healthy. An older, strict push service would reject any push that carries the new field.

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 app build that grants rpcEnvelope (#27815) before server workspaces appear. Until
then the phone shows today's list, with no server rows.

What Changed

Before: the desktop forwarded alerts for agents on its servers, but the push named only the server's
workspace id.

After:

  • Desktop. notificationExecutionHostForOwner (src/shared/notification-source.ts) turns the
    workspace owner's server into runtime:<env>. It shares the environment lookup with
    notificationSourceForOwner, so ephemeral VMs still route to their server.
    • Both notification producers set it: terminal alerts (use-notification-dispatch.ts) and structured
      agent sessions (structured-attention-dispatch.ts).
    • It travels as one optional field: NotificationDispatchRequest → MobileNotificationDispatchEvent →
      push dispatcher → push service (which accepts it since feat(push): accept a notification's workspace server #26516).
  • Phone. The push payload and receive path pass the field through. notification-routing.ts accepts
    only runtime: ids and opens the route with executionHost, so the workspace route scopes every
    screen to that server (feat(mobile): show and use the desktop's server workspaces on the phone #26501). A missing or invalid field behaves as today.
  • "Don't alert me about the workspace I'm viewing" now also compares the server, because the same
    workspace id can exist on two hosts.

Why

The desktop already knows which server each workspace runs on, so it states that fact in the push. The
phone doesn't have to guess.

Rejected alternative: having the phone look up the host at tap time from the desktop's server list. It
avoids the push-service change, but it's a guess on the phone.

Linked Issue

N/A (maintainer)

Visual Proof

N/A. Notification routing only; no UI change.

Testing

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

Every hop in this PR has a test that fails when that hop is reverted (the push service's own schema and
delivery tests are in #26516):

  • both producers, including an owner that names only its server;
  • the delivery service and push dispatcher;
  • the phone's push payload and receive path;
  • notification routing;
  • the viewing-suppression check, which compares the server too.

Phone notification and routing tests pass (28/28). An end-to-end run with a real push needs the live push
service, so the per-hop tests are the evidence.

Notes

  • No duplicates. The phone registers for push and subscribes to notifications only on the desktop
    (notifications.* are desktop-only in the routing table), so a server never pushes to the phone itself.
  • Covered producers: agent hooks, the parked-terminal watcher, terminal bell and completion, and
    native chat all go through the two updated producers. SSH and local workspaces send no server.
  • Mixed versions: an old phone ignores the field and an old desktop never sends it. A new desktop
    needs the push service from feat(push): accept a notification's workspace server #26516; never roll the push service back below it once this ships.

… 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
Jinwoo-H and others added 19 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
…ions

# Conflicts:
#	src/renderer/src/components/native-chat/structured-attention-dispatch.ts
…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 changed the base branch from feat/mobile-remote-workspaces to main October 14, 2026 03:37
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 323a5b96-40e7-4e6a-bff0-c69f72abe434
📥 Commits

Reviewing files that changed from the base of the PR and between b2fbdf0 and 0a8ebef.

📒 Files selected for processing: 18
  • mobile/app/_layout.tsx
  • mobile/src/notifications/notification-routing.test.ts
  • mobile/src/notifications/notification-routing.ts
  • mobile/src/notifications/notification-viewing-policy.ts
  • mobile/src/notifications/push-payload.ts
  • mobile/src/notifications/push-receive.test.ts
  • mobile/src/notifications/push-receive.ts
  • src/main/notifications/notification-delivery-service.test.ts
  • src/main/notifications/notification-delivery-service.ts
  • src/main/runtime/push/push-dispatcher.ts
  • src/main/runtime/push/push-gateway-client.ts
  • src/main/runtime/runtime-mobile-notification-controller.ts
  • src/renderer/src/components/native-chat/structured-attention-dispatch.test.ts
  • src/renderer/src/components/native-chat/structured-attention-dispatch.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
  • src/shared/notification-settings-types.ts
  • src/shared/notification-source.ts
📝 Walkthrough

Notification dispatch now derives an optional runtime execution host from the workspace owner and carries it through delivery and push payloads. Mobile clients parse the value, include valid runtime hosts in notification navigation, and require the viewed and incoming execution hosts to match when applying foreground suppression.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to b2fbd

This change routes server-agent notification taps to the server. Two narrow edge cases remain: an alert can occasionally be dropped when two hosts use the same workspace ID, and a foreground banner may show when an invalid host is present. Both are low impact and can be followed up after merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 18 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: opening notifications for server agents on the correct server.
Description check Passed The description covers the user impact, implementation flow, rationale, issue status, visual proof, testing, compatibility, and deployment dependencies. It omits the template's explicit Review, Agent …
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.
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@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: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0ab41474-218e-456c-9ef8-010607f8ee9a
📥 Commits

Reviewing files that changed from the base of the PR and between 5f134d8 and b2fbdf0.

📒 Files selected for processing: 18
  • mobile/app/_layout.tsx
  • mobile/src/notifications/notification-routing.test.ts
  • mobile/src/notifications/notification-routing.ts
  • mobile/src/notifications/notification-viewing-policy.ts
  • mobile/src/notifications/push-payload.ts
  • mobile/src/notifications/push-receive.test.ts
  • mobile/src/notifications/push-receive.ts
  • src/main/notifications/notification-delivery-service.test.ts
  • src/main/notifications/notification-delivery-service.ts
  • src/main/runtime/push/push-dispatcher.ts
  • src/main/runtime/push/push-gateway-client.ts
  • src/main/runtime/runtime-mobile-notification-controller.ts
  • src/renderer/src/components/native-chat/structured-attention-dispatch.test.ts
  • src/renderer/src/components/native-chat/structured-attention-dispatch.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/use-notification-dispatch.ts
  • src/shared/notification-settings-types.ts
  • src/shared/notification-source.ts

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

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