Repository navigation
feat(hosts): open a paired host's chat and follow its runs live (multi-host PR 6) - #317
Conversation
Adds the PR 6 plan, host-scoped chat and messages-window query keys, and a pure mapper from the host's messages window to ChatMessage with newest and older page merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pure reducer from the host's run events to the inputs MessageList takes: reset and gap snapshots, duplicate and run.ended sequences, run switches, truncated subscriptions and read-only pending prompts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The renderer reads a paired host's chat through a HostChatAdapter that wraps the peer IPC and fences answers by supervisor generation, and a framework-free RemoteChatSession that pages the transcript, follows the chat's run stream and marks the newest message read. An in-process test drives both through main's real live handlers and supervisor against a host built from the real run journal and transcript projection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workbench hides its Environment and Quick View surfaces while a remote chat is open, without changing whether the user left them open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the 5b placeholder on /host/$hostId/chat/$chatId with the remote chat view: the shared MessageList, Load older paging, the live run from the host's stream, read-only approval and question cards, and a host status header that keeps the transcript visible as last-known while offline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bar' into feat/multi-host-pr6-remote-chat-view
…ws one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Important
Truncated shared-stream replay can permanently hide a pending approval or question. Preserve that attention state before merging.
Reviewed changes Reviewed the full remote-chat viewing and live-observation implementation against the stacked PR 5b base.
- Remote data path: Adds the host adapter, generation-fenced reads, serialized chat session, host-qualified transcript cache, paging and read markers.
- Live transcript: Maps host messages and translates run events, including replay, reset/gap recovery, terminal outcomes and persisted-response handoff.
- Read-only UI: Replaces the placeholder route with the shared transcript, host status and recovery actions, read-only prompt cards, and suppression of local Environment surfaces.
- Coverage and plans: Registers the new integration, mapping, reducer and rendering suites and updates the plan documentation.
Validation passed: npm run type-check, test:remote-chat (29 tests), test:peer-hosts (58) and test:sidebar (85). A separate check using the real host registry and peer buffer reproduced the inline finding. Electron E2E and native runtime suites were not executed in this Linux environment.
gpt-6.1-sol | 𝕏
PeerRunStream bounds each run's buffer, so a window that joined or resubscribed to a long run lost an approval or question whose event had been evicted. Fold evicted events into the prompts still pending and hand viewers behind the buffer that summary as a gap snapshot, the shape the host already sends. Resolutions and terminal events clear it, so retention stays bounded by the open prompts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the two commits since the previous Pullfrog review, with the full PR diff as context.
- Preserved pending prompts: Folded evicted run events into an attention summary and prepended a gap snapshot to truncated replay, retaining unanswered prompts and removing resolved ones.
- Corrected initial host status: Kept the sidebar's availability until the chat session knows its supervisor generation, and derived stale presentation from the effective host status.
- Extended behavioral coverage: Added joining-viewer, evicted-resolution, terminal-cleanup and resubscription checks, plus an integration test through the real host services and peer IPC.
Validation passed: npm run type-check, test:remote-chat (30 tests), test:peer-hosts (61), test:sidebar (85), and focused host-run registry/service suites (35). Electron E2E and native runtime suites were not run in this Linux environment; the delta changes no host/mobile wire contract. Exact-head hosted CI was still in progress when inspected.
gpt-6.1-sol | 𝕏
very-hermes-bot
left a comment
There was a problem hiding this comment.
Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.
Hermes Review BotConfidence: 5 Engine: SummaryOpening a paired host's chat at Confidence Score: 5/5Full end-to-end trace completed across main host services, IPC layer, stream translator reducer, adapter fencing, session queue, and rendered React components, corroborated by behavioral in-process test fixtures. 📁 Important Files Changed
FindingsNo findings. Sequence DiagramsequenceDiagram
autonumber
actor User as User / View
participant Session as RemoteChatSession
participant Adapter as RemoteHostAdapter
participant Manager as PeerHostManager (Main)
participant Peer as Paired Host
User->>Session: Mount /host/$hostId/chat/$chatId
Session->>Adapter: getMessagesWindow(chatId)
Adapter->>Manager: IPC remote:peerCall (messagesWindow)
Manager->>Peer: GET /chats/$chatId/messages?limit=50
Peer-->>Manager: 200 OK (50 messages projection)
Manager-->>Adapter: OK (RemoteMessagesWindow)
Adapter-->>Session: RemoteMessagesWindow
Session->>User: Render transcript (MessageList)
Session->>Adapter: observe(chatId)
Adapter->>Manager: IPC remote:peerRunSubscribe
Manager->>Peer: SSE /host/events & /runs/.../events
Peer-->>Manager: Events (text_delta, reasoning, tool)
Manager-->>Adapter: IPC remote:peer-run-frame
Adapter-->>Session: onEvent(event)
Session->>User: Stream live reply in MessageList
Peer-->>Manager: Event: done / run.ended
Manager-->>Adapter: onEvent(done)
Adapter-->>Session: onEvent(done)
Session->>Adapter: getMessagesWindow(chatId) [refetch turn]
Adapter->>Manager: IPC remote:peerCall (messagesWindow)
Manager->>Peer: GET /chats/$chatId/messages?limit=50
Peer-->>Manager: 200 OK (updated window with assistant reply)
Manager-->>Adapter: OK (updated window)
Adapter-->>Session: RemoteMessagesWindow
Session->>User: handOffRemoteRun: replace streaming row with persisted message
Session->>Adapter: markRead(chatId, messageId)
[]
|
…sconnected A direct open or refresh of /host/$hostId/chat/$chatId mounted before the sidebar had read the paired-host list, so the route flashed "This Mac is not connected". Show Loading… while the list is pending, let a host with no status yet read as connecting, and say so when the list read fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed a11d2b4d since the prior Pullfrog review, using the full PR diff as context.
- Corrected cold-route states: Waited for the paired-host list before reporting a missing Mac, displayed list-read failures separately, and retained connecting status until the host reports availability.
- Enabled route-level coverage: Extracted
RemoteChatRoutefrom router navigation and supplied the external store's server snapshot so rendering tests exercise the actual query-backed route. - Extended behavioral tests and documentation: Covered pending, connecting, connected, unpaired, disabled and failed-read states, and documented the direct-open behavior.
Validation passed: npm run type-check, test:remote-chat (32 tests) and test:sidebar (85 tests). Electron E2E and native runtime suites were not run in this Linux environment; this delta changes no shared host/mobile contract. Hosted CI was still running when inspected.
gpt-6.1-sol | 𝕏
very-hermes-bot
left a comment
There was a problem hiding this comment.
Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.
… its id The streamed row stayed until a window held the done event's message id. The host names a synthetic assistant_<turnId> id when its done payload carries no assistant message, and a run seen only through run.ended has no id at all, so the reply showed twice for good. Once the session reads the newest window after the run settles, that window owns the reply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bar' into feat/multi-host-pr6-remote-chat-view
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the changes since a11d2b4d, including the stacked-base merge, with the complete PR diff as context.
- Corrected settled-reply handoff: Recorded successful newest-window reconciliation so a finished streamed reply yields to persisted history even when the host reports a synthetic or missing message ID.
- Added behavioral coverage: Covered synthetic-ID completion,
run.ended-only settlement, reads during an active run, and handoff reset for a subsequent run; documented the reconciliation rule.
Validation passed: npm run type-check, test:remote-chat (34 tests) and test:peer-hosts (62 tests). Additional checks through the real session confirmed that held, failed and fenced terminal reads retain the streamed reply until successful reconciliation. Verified the host's persistence-before-completion ordering and inspected both native reconciliation paths; this delta changes no shared wire contract. Electron E2E and native runtime suites were not run in this Linux environment. Exact-head hosted verify passed; Hermes Review Bot was still pending.
gpt-6.1-sol | 𝕏
…bar' into feat/multi-host-pr6-remote-chat-view # Conflicts: # package.json # scripts/ci-test-registry.json
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the stacked-base merge since 42a8eb76, using the incremental diff and complete PR diff as context; PR 6's remote-chat implementation is unchanged.
- Integrated sidebar refresh recovery: Checked the inherited remount refresh fix against the remote route's shared query observers and session-owned transcript cache.
- Preserved test coverage: Checked the merged sidebar test registration and CI inventory, retaining the remote-chat suites alongside the new hook coverage.
Validation passed: npm run type-check, test:remote-chat (34 tests), test:sidebar (88 tests), and test:ci-policy (47 tests). Previous Pullfrog feedback remains resolved. Electron E2E and native runtime suites were not run locally; this delta changes no shared wire contract. Broader hosted CI was still running when inspected.
gpt-6.1-sol | 𝕏
…bar' into feat/multi-host-pr6-remote-chat-view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the stacked-base merge since 49bc1266, with the complete PR diff as context; PR 6's remote-chat implementation is unchanged.
- Integrated eager sidebar refresh so cached statuses and feeds are read immediately after listeners return, preventing new broadcasts from masking changes missed in Settings.
- Reused buffered feed reconciliation for both eager and ordinary reads, preserving the remote route's cache-only observers and session-owned transcript cache.
- Added remount-race coverage that checks both missed chat rows and another host's changed availability during listener reinstallation.
Validation passed: npm run type-check, test:sidebar (89 tests) and test:remote-chat (34 tests). The new race test failed as expected when eager reads were replaced with the old invalidate-only behavior; an additional check with cache-only observers passed and retained the transcript cache. Existing Pullfrog feedback remains resolved. Electron E2E and native runtime suites were not run locally; this delta changes no shared wire contract. Broader hosted CI was still pending/running when inspected.
gpt-6.1-sol | 𝕏
…bar' into feat/multi-host-pr6-remote-chat-view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # package.json
Main now folds unread deltas, so the gap-snapshot test's twenty deltas under a frozen clock became one event and the journal never overflowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the delta since ed78fa66, using the complete PR diff as context.
- Preserved overflow coverage: Disabled journal delta coalescing in the frozen-clock fake host so the integration test still exercises host-journal gap recovery after the stacked-base update.
- Reconciled test registration: Retained
test:remote-chatin the mergedtest:serialchain and verified its suites remain assigned to the parallel CI registry.
Validation passed: npm run type-check, test:remote-chat (34 tests), test:peer-hosts (62), test:ci-policy (55), and focused host-registry, host-run and projection suites (55). An isolated mutation restoring fake-host coalescing failed the journal-gap assertion as expected, confirming the fixture adjustment preserves meaningful coverage. Existing Pullfrog feedback remains resolved. Electron E2E and native runtime suites were not run locally; the PR-specific delta changes no production wire contract. Broader hosted CI was still queued/running when inspected.
gpt-6.1-sol | 𝕏
…bar' into feat/multi-host-pr6-remote-chat-view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # package.json # renderer/main/router.tsx
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the stacked-base merge since 682cd9fa, using the incremental diff and complete PR diff as context; PR 6's remote-chat implementation is unchanged.
- Integrated application query defaults and checked them against the sidebar's explicit freshness overrides, broadcast recovery and session-owned transcript reads.
- Preserved remote route wiring while incorporating the base's router changes, retaining the host/chat-keyed
RemoteChatViewand local-panel suppression. - Reconciled test registration in the serial chain and parallel CI inventory, retaining all four remote-chat suites alongside inherited tests.
Validation passed: npm run type-check, test:remote-chat (34 tests), test:sidebar (89), test:ci-policy (55), and the query-client/git-query-sync suites (8). Existing Pullfrog feedback remains resolved. Electron E2E and native runtime suites were not run locally; this PR-specific delta changes no shared wire contract. Exact-head hosted verify, TypeScript/lint and CI inventory passed; broader CI was still queued/running when inspected.
gpt-6.1-sol | 𝕏
…bar' into feat/multi-host-pr6-remote-chat-view Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # docs/plans/README.md # package.json
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the stacked-base merge since 5713f3a1, using the incremental diff and complete PR diff as context; PR 6's remote-chat implementation is unchanged.
- Integrated shared streaming optimizations and checked the memoized transcript rows, incremental Markdown reveal and ScrollArea measurement changes against the remote view. Confirmed host-run journaling still precedes local delta batching, preserving peer observation.
- Preserved test coverage through the serial-chain merge: added the inherited coalescer and packaging/performance suites without removing existing commands, and retained all four remote-chat suites in the CI inventory.
Validation passed: npm run type-check, test:remote-chat (34 tests), test:peer-hosts (62), test:sidebar (89), test:ci-policy (55), focused streaming/transcript/runtime suites (92), and the newly merged packaging/performance suites (7). Existing Pullfrog feedback remains resolved. Electron E2E and native runtime suites were not run locally; this delta changes no shared wire contract. Exact-head hosted verify passed; broader CI was still queued when inspected.
gpt-6.1-sol | 𝕏

Delivery PR 6 of the desktop multi-host control plan: open a paired host's chat on this Mac and follow its runs live. This PR covers viewing and observation only. Sending and the controls (cancel, approvals, questions, steer, rename, remove) come in PR 7.
Stack: #310 ← #313 ← #314 ← #316 ← this PR. The base is
feat/multi-host-pr5b-remote-sidebar.Plan:
docs/plans/desktop-multi-host-pr6-remote-chat-view.mdWhat changes
The route
/host/$hostId/chat/$chatIdnow renders the real remote chat instead of the 5b placeholder:MessageListandScrollArea. The newest 50 messages load first; Load older reads the next 50 usingbefore.<machine> · <availability>.EnvironmentWorkbenchgains asuppressedflag that hides its surfaces on a remote route without changing whether the user left them open.New modules (
renderer/lib/hosts/)host-query-keys.tsaddschatandmessagesWindow.remote-chat-mapper.tsmaps the host projection toChat/ChatMessageand merges paged windows. It is pure.remote-stream-translator.tsis a pure reducer fromPeerRunEventto the transcript statechat-panefeedsMessageList. It handles snapshot reset, gap reseed and refetch, run switch, duplicate andrun.endedsequences, truncation and terminal outcomes.host-chat-adapter.tsdefines theHostChatAdapterinterface.remote-host-adapter.tsimplements it overpeerHostsApi:markRead.remote-chat-session.tsis a framework-free store for one open chat:No contract changes
PR 6 uses the PR 2 host operations and the PR 3 peer IPC unchanged. No protocol revision, operation or channel is added. iOS and Android are unaffected. Credentials stay in main: the in-process test asserts that nothing delivered to the renderer contains the host credential or endpoint.
Tests
main/services/peer-remote-chat-view.test.ts(new). It wires the real PR 2 host services (run registry, run projection, messages-window projection, read markers) behind the realPeerHostRegistry,PeerHostManagerand live IPC handlers, and drives the real adapter and session.markRead.renderer/main/remote-chat-view.test.tsx(new). RendersRemoteChatPaneto static markup and covers:remote-chat-mapper.test.tsuses the real host projection as the oracle.remote-stream-translator.test.tshas 11 tests.test:remote-chatscript, which is appended totest, and inscripts/ci-test-registry.json.Run locally:
npm run type-check, eslint on the touched files,test:remote-chat(29),test:sidebar(85),test:peer-hosts(58),test:ci-policy(47), plusmessage-bubble,chat-transitionandenvironment-subagents-contract.🤖 Generated with Claude Code