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(mobile): list a server once when the phone also pairs with it directly - #51647
Once your phone pairs with a server directly (for example with "Keep reachable" from #51311), your Mac kept listing that same server too, so its workspaces showed up twice: once under the server and once under the Mac. Now the phone uses the direct pairing alone and hides the Mac's copy, so each server has one home on the phone whether the Mac is awake or not.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
16
$\color{#1a7f37}{\Huge{\mathbf{+}}}$245
$\color{#cf222e}{\Huge{\mathbf{−}}}$23
$\color{#1a7f37}{\Huge{\mathbf{+}}}$222
What Changed
Native app
It records each directly paired host's installation id from its own status.get on every connect. The record lives in memory and is dropped when the host is removed.
A pairing that host refused stops counting, so the Mac's copy comes back if the direct pairing breaks.
A direct pairing counts only if it reaches the server at least as far as the Mac does. A LAN-only pairing never hides a copy that the Mac reaches through Orca Relay or Tailscale; this is re-checked when a host upgrades to Relay in place.
Bridge
A new read-only native verb, native.pairings.installations, returns that set for the page's own host. It is an optional grant on every page route.
Page
The relay-hosts feed, the one feed the host screen's server rows, the pickers and workspace routing read, drops a relayed server whose installation the phone pairs with directly.
A workspace already open under the Mac's route keeps resolving against the full list, so it doesn't drop to "disconnected".
Why
Kelvin's call: once directly paired, the phone always uses the direct route and hides the relayed copy. That keeps one host id per server, so workspaces, drafts and notifications don't jump between two hosts when the Mac wakes.
The phone is the only party that knows all its own pairings, including ones made by hand, so the fact belongs to the phone. The relay-hosts feed is the single place every page list reads relayed servers, so one filter there covers them all.
Real iOS simulator (iPhone 18 Pro, iOS 27.2) with three processes: the phone; a desktop, run as a worktree serve, serving this branch's page; and a server, run as a hidden desktop build. The phone is paired with both the Mac and the server.
Before: the Mac's screen still lists the server's workspaces
After (light)
After (dark)
Home: the server's workspaces under the server
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
(screenshot removed: contained real product data)
The "before" capture is the released app, which lacks the new verb, on the same profile. It also shows the old-shell fallback.
Testing
With the server's direct pairing refused, the Mac's screen listed the server's repo/main and ~ workspaces.
After pairing the server directly from the workspace sheet, the Mac's screen showed none of them. The server's own entry on Home listed both ("2 worktrees").
The released 0.0.71 app on the same profile still listed them under the Mac: old shells behave as today.
Typecheck, lint and the changed-files gate pass.
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 unit test: the rule is a small filter over live connection state, and the proof is the real run above.
Performance
Feed reads: each relay-hosts read adds one bridge round trip, run in parallel with the existing mobileRelay.hosts.list call. That is one per 60-second backstop on desktops that push changes, or one per 3-second poll on older desktops. The shell answers from an in-memory map of the phone's paired hosts.
Elsewhere: no timers, persistence or native work beyond a set update per connect.
Risk
Hiding a route the phone needs: the riskiest part. That is why a refused pairing stops counting, and why LAN-only pairings never hide a copy the Mac reaches off-LAN.
Staleness: the page learns of a new direct pairing on its next relay-hosts read, so the copy can linger up to a minute.
Back-out: a plain revert restores today's duplicates.
Level: Medium
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
Store build needed for the native half (recording installations and the new verb). The page filter is gated on the shell granting the verb, so older apps keep showing both copies.
Known follow-ups (P2):
An Automations screen whose selected server gets hidden loses that selection. Workaround: pick the server's own host.
On a cold launch, restored server rows can show under the Mac until the first relay-hosts read.
The shared server-workspaces query still reads every relayed server, as main does today, so open routes (folder Source Control included) resolve against the full set. Only the host list hides the directly paired ones.
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
The mobile app now tracks each host’s direct-pairing installation ID, refusal state, and off-LAN reachability. A new native bridge verb provides eligible installation IDs to supported web pages. The relay-host feed uses those IDs to exclude directly paired hosts from its default listed view, while retaining an all-hosts view. The workspace server requests the all-hosts view.
Merge Risk: Minimal · up to fc8f6
The change hides a server that the phone also pairs with directly from the Mac's relayed list. The worst failure case is a duplicate row, and open routes still resolve against the full server list. No merge-blocking risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(mobile): list a server once when the phone also pairs with it directly" matches the main change. The PR filters the relay-hosts feed so a server that the phone pairs with directly appe…
Description check
The description follows the repository template closely. It has ELI5, What Changed, Why, Visual Proof with before and after images, Testing, Performance, Risk with a level, and Checklist sections. It …
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 "feat(mobile): list a server once when the phone also pairs with it directly" matches the main change. The PR filters the relay-hosts feed so a server that the phone pairs with directly appears once, not under both the direct pairing and the relaying Mac. The raw summary covers the installation tracking, the new bridge verb, and the feed filter that support this goal. The title is specific and concise, and it does not use vague terms.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed, Why, Visual Proof with before and after images, Testing, Performance, Risk with a level, and Checklist sections. It explains the mechanism, the alternatives considered (Kelvin's call), the refused-pairing and LAN-only rules, and the back-out path. Gaps: the Linked Issue section cites related issues (#40079, #27988, #26291, #10426) but has no 'Fixes #' line, and the template asks for one issue for outside contributors. The AI Disclosure section is empty. The Performance section is filled in. The final pnpm lint/typecheck/test/build checklist item is unchecked, and the Testing section says typecheck, lint and the changed-files gate pass, so the status is unclear. These are minor gaps, so the description is mostly complete.
Resolution
Optional improvements: state the issue this PR closes or fixes in the Linked Issue section, fill in the AI Disclosure section, and check or explain the unchecked pnpm build/test checklist item.
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; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
…rs with directly
Once the phone pairs with a server directly, the desktop it was relayed
through kept listing the same server, so its workspaces showed twice and
reopened under the desktop when it woke. The phone now records each direct
host's installation from status.get on every connect, a new read-only native
verb hands that set to the page, and the page's relay-hosts feed drops a
relayed server with a matching installation. A direct pairing the host
refused stops counting, so its relayed copy shows again. Older shells lack
the verb and keep today's behaviour. The native half needs a store build.
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
Once your phone pairs with a server directly (for example with "Keep reachable" from #51311), your Mac kept listing that same server too, so its workspaces showed up twice: once under the server and once under the Mac. Now the phone uses the direct pairing alone and hides the Mac's copy, so each server has one home on the phone whether the Mac is awake or not.
What Changed
Native app
status.geton every connect. The record lives in memory and is dropped when the host is removed.Bridge
native.pairings.installations, returns that set for the page's own host. It is an optional grant on every page route.Page
Why
Kelvin's call: once directly paired, the phone always uses the direct route and hides the relayed copy. That keeps one host id per server, so workspaces, drafts and notifications don't jump between two hosts when the Mac wakes.
The phone is the only party that knows all its own pairings, including ones made by hand, so the fact belongs to the phone. The relay-hosts feed is the single place every page list reads relayed servers, so one filter there covers them all.
Linked Issue
Part of #40079, #27988, #26291 and #10426, following #51311 (the phone's own server pairing).
Visual Proof
Real iOS simulator (iPhone 18 Pro, iOS 27.2) with three processes: the phone; a desktop, run as a worktree serve, serving this branch's page; and a server, run as a hidden desktop build. The phone is paired with both the Mac and the server.
The "before" capture is the released app, which lacks the new verb, on the same profile. It also shows the old-shell fallback.
Testing
With the server's direct pairing refused, the Mac's screen listed the server's
repo/mainand~workspaces.After pairing the server directly from the workspace sheet, the Mac's screen showed none of them. The server's own entry on Home listed both ("2 worktrees").
The released 0.0.71 app on the same profile still listed them under the Mac: old shells behave as today.
Typecheck, lint and the changed-files gate pass.
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 unit test: the rule is a small filter over live connection state, and the proof is the real run above.
Performance
mobileRelay.hosts.listcall. That is one per 60-second backstop on desktops that push changes, or one per 3-second poll on older desktops. The shell answers from an in-memory map of the phone's paired hosts.Risk
Level: Medium
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
Store build needed for the native half (recording installations and the new verb). The page filter is gated on the shell granting the verb, so older apps keep showing both copies.
Known follow-ups (P2):
The shared server-workspaces query still reads every relayed server, as main does today, so open routes (folder Source Control included) resolve against the full set. Only the host list hides the directly paired ones.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)