Repository navigation
fix(desktop): a conversation's settings event is not a run - #1369
Merged
Merged
Conversation
Clicking a paired machine's row in the recent view filed it under "active" and then moved it back, for a conversation that was not running. The Agent clears `runId` on everything session-scoped, and the host replays that session journal whenever it creates a conversation's observer - which is exactly what opening a conversation does - so a `model_changed` from days ago arrived on the live lane the moment the row was clicked. The rail read any push for a conversation as "its run is in flight", which is right for a run's own events (their type list is open-ended) and wrong for these; the next catalogue read, the five-second peer poll, then took the row back out of the active stretch. Liveness is now settled only by a run's own event: a session-scope event carries no `runId` and says nothing about a run. A prompt that has not started loses no accuracy - the host's catalogue states its run's `status`, and `isActiveRun` reads it.
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.
A conversation's settings events (
model_changed,session_name_changed, a standalone compaction) carry an emptyrunId, and the host replays that part of its journal whenever it creates a conversation's observer — which is exactly what opening a conversation does.useRemotePeerstreated any event as "a run is in flight", so amodel_changedrecorded days earlier put the row the reader had just clicked into the recent view's "active" stretch, and the next catalogue read moved it back out. This makes an event without arunIda no-op for the streaming flag instead of a guess.Behaviour
runIdreturns early and leavesstreaminguntouched — it neither raises nor clears the flag, so a conversation that is running keeps its dot through a settings change.status, andisActiveRunalready reads it.Commits
Verification
npm run lint(eslintsrc/**+shot/**+vite.shot.config.ts, thentsc --noEmit) → cleannpx vitest runindesktop/→ 382 files, 5292 tests passeddoes not read a conversations settings event as a runinuseRemotePeers.test.tscovers both halves: a replayedmodel_changedmust not mark the row active, and asession_name_changedarriving mid-run must not clear a live dot.