Repository navigation
fix(mobile): Home lists only directly paired desktops' agents again, as in v1.4.279 - #50787
Conversation
…as in v1.4.279 Home's Agents and Feed stop merging in agents from servers a desktop relays to. Home no longer reads a relayed server's rows whenever its row notice fires, which made each such desktop refetch the server's whole workspace list and hash every row. Its blur release, which dropped every row hold on the phone connection, goes with it. Kept: the shared relay capability, the relay host schema and the desktop protocol. Home Bots still reads the relay list and listens for relayHostsChanged, and workspace lists still read relayed rows through ServerRowSnapshots. The retired-server eviction test now covers the shared ServerRowSnapshots.read path rather than Home's private snapshots.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…as in v1.4.279 (stablyai#50787) Home's Agents and Feed stop merging in agents from servers a desktop relays to. Home no longer reads a relayed server's rows whenever its row notice fires, which made each such desktop refetch the server's whole workspace list and hash every row. Its blur release, which dropped every row hold on the phone connection, goes with it. Kept: the shared relay capability, the relay host schema and the desktop protocol. Home Bots still reads the relay list and listens for relayHostsChanged, and workspace lists still read relayed rows through ServerRowSnapshots. The retired-server eviction test now covers the shared ServerRowSnapshots.read path rather than Home's private snapshots. (cherry picked from commit c508766)
ELI5
Home's agent lists go back to showing only the agents on desktops the phone is paired with, as they did in v1.4.279. Agents on servers that a desktop relays to no longer appear on Home. Those servers' workspaces and bots are still reachable as before.
What Changed
This is a scoped rollback of Home's relayed-agent integration from #49357, plus the follow-ups that only that integration used. It is not a revert of #49357 as a whole.
Removed (Home-only):
use-home-server-agents.ts, including its blurunwatchRowseffect from fix(mobile-relay): deduplicate client-event streams, release blurred holds, and cut redundant host listings #49478;home-relayed-servers.tsandhome-relayed-server-queries.ts, with their tests;relayHosts.homeServerskey;ServerRowSnapshots.readOne;relayHostsUnwatchRowsoperation;HomeAgentEntry.executionHost, per-server grouping inagent-list-rows.ts, the server label and the route'sexecutionHost).Home now:
agentListreads each desktop's ownworktreeInfoagain. Agents, Feed, Active and Needs You counts, and the empty state match v1.4.279.use-agent-list-row-actions.tsx,home-worktree-info.tsandhome-query-restore.tsare back to their v1.4.279 contents.agent-list-rows.tsandMobileAgentListRows.tsxkeep the later unrelated changes from #48765 and #48822.Kept unchanged:
MOBILE_RELAY_HOST_ROWS_CHANGED_EVENT_RUNTIME_CAPABILITY(only its comment is updated);relayHostSchema.rowChanges;relayHostsChangedsignal;ServerRowSnapshots.read/retain.No data migration. An unused prerelease cache entry for
relayHosts.homeServersis left as is.Why
A relayed server's row notice could trigger a Home rows read. The desktop refreshed that server's full workspace list (
worktree.ps) and, for snapshot-capable clients, hashed every returned row to compute the delta.On blur, Home also sent
unwatchRows, which releases every row hold on the phone connection, including holds that a workspace screen still needs. This returns Home's agent lists to their behavior in v1.4.279.Linked Issue
Partially rolls back #49357 (Home relayed agents) and the Home parts of #49478 and #49472.
Visual Proof
Home shows fewer rows. Relay-only agents no longer appear, and the layout, copy and empty state are unchanged from v1.4.279. I haven't attached captures.
Testing
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
The retired-server eviction test that fix(mobile): evict retired servers from Home private row snapshots (STA-18544) #49469 added for Home's private snapshots now lives in
mobile/src/worktree/execution-hosts/server-workspaces.test.ts. It covers the sharedServerRowSnapshots.readpath: a dropped and re-added server starts a fresh read, and the server that stays listed keeps its snapshot. This preserves coverage, so it also passes without this change.Source checks against the base and PR head show that the Home agent row observer, persisted restore wiring, and Home blur unwatch caller are gone. The desktop handlers, Home Bots and ordinary workspace query paths are unchanged.
Mobile verify passed lint, typechecks, formatting and tests. Other GitHub checks are reported on this PR.
Performance
These figures are source-derived, not measured. For a phone with Home open and a relayed server with N workspaces:
worktree.psinventory read of up to 10,000 rows, with additional host listing and row processing. Snapshot-capable reads also serialized and hashed each returned row, then decoded the reply on the phone.Risk
Level: Medium.
Users who used Home's "All desktops" list to watch agents on relayed servers no longer see those agents on Home. They can still reach them from the server's workspace screens. Phones and desktops stay protocol-compatible in both directions, because the desktop is unchanged and the phone keeps advertising the same capability.
To back out, revert this PR.
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
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)