Repository navigation
feat(remote-peer): manage and start a remote conversation from the desktop - #958
Merged
Merged
Conversation
…ute expects A remote conversation has two ids on its host, and they are not interchangeable: prompt, abort and history reads are session-scoped, while pin and delete go through the host's thread store. The merged list kept only the session id, which left pin and delete unaddressable -- and guessing that the two ids are the same would have pinned or deleted the wrong record. Carry the host's thread id through the merge (a local row's thread id is its own id, so nothing is translated there), and add the client helpers for the lifecycle commands, each named for the id it takes. A host that reports no thread id (one predating the catalogue field) is refused rather than sent the session id in its place. An empty session id is the host's own signal for "a conversation that does not exist yet": it creates the thread and answers with the ids it chose, so the ack is the only way to learn them.
…sktop Reading another machine's conversations was possible; doing anything with them was not. Add the three controls a conversation cannot be used without, all issued to the host that owns it: - **Row actions** (rename / pin / delete) behind an overflow control on the remote row. Not a reuse of the local row's menu: every action there calls the local store or the local agent, and the local store has never heard of a remote session -- sharing it would mean sharing the dispatch, and a rename would land on a local thread with a coincidentally matching id. An item stays open while its command runs, because a refusal that disappears with the menu is no message at all. Pin and delete are disabled when the host reported no thread id. - **Stop**, replacing Send while a run is in flight on the host (a host answers one prompt at a time and refuses a second). - **New conversation** on a chosen desktop, from the desktop-management screen where the machines already live. A draft is addressed with an empty session id and the shell adopts the ids in the host's ack -- without that, the next prompt would create a second conversation. Rename gets its own dialog rather than the local one, which carries the local store's generating/error state and a "generate title" action backed by the local agent.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this does
Reading another machine's conversations worked; doing anything with them did not. This adds the lifecycle controls a remote conversation needs, all issued to the host that owns it.
Row actions — rename / pin / delete, behind an overflow control on the remote row. Not a reuse of the local row's menu: every action there calls the local store or the local agent, and the local store has never heard of a remote session. Sharing the component would mean sharing the dispatch, and a rename would land on a local thread with a coincidentally matching id.
Stop, replacing Send while a run is in flight on the host (a host answers one prompt at a time and refuses a second).
New conversation on a chosen desktop, from the desktop-management screen where the machines already live. A draft is addressed with an empty session id — the host's own signal to create the conversation — and the shell adopts the ids in the host's ack. Without that adoption the next prompt would create a second conversation.
Rename gets its own dialog rather than the local one, which carries the local store's generating/error state and a "generate title" action backed by the local agent.
The id distinction, which is the substance here
A remote conversation has two ids on its host and they are not interchangeable: prompt, abort and history reads are session-scoped, while pin and delete go through the host's thread store. The merged list kept only the session id, which left pin and delete unaddressable — and treating the two as the same would have pinned or deleted the wrong record. The merge now carries
threadId(a local row's thread id is its own id, so nothing is translated there), the client helpers are named for the id each takes, and a host that reports no thread id is refused rather than sent the session id in its place.Tests
78 new tests; the desktop suite is 3388 passing.
tsc --noEmit,eslint(0 errors),stylelint, and the shared shell-projection test all pass — the same scope CI runs.What is asserted is where a mistake would be silent:
desktopIdis delivered to another host, the failure this whole screen exists to avoid.One thing I removed rather than tested
Both "second call while in flight" guards in the menu and the composer were unreachable: the controls that invoke them are
disabledwhile a command is outstanding, and React flushes state between discrete clicks, so a second invocation cannot be produced from the UI. Rather than keep defensive code no test can reach, I deleted the guards and leftdisabledas the single mechanism — which is what the tests assert. (The composer's equivalentbusyguard stays, because it is reachable: Enter can callsend()while the Send button is disabled.)Coverage
Measured with the repo's documented method (v8 provider, full
src/**include), then intersected with this branch's own diff:Every file this PR adds or modifies is at zero uncovered lines.
Related
Follows #955 (client role + merged lists), #956 (client runtime + multi-host e2e), #957 (a prompt names a conversation rather than creating one — the ack contract this builds on).