Skip to content

fix(desktop): a conversation's settings event is not a run - #1369

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Oct 26, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

A conversation's settings events (model_changed, session_name_changed, a standalone compaction) carry an empty runId, and the host replays that part of its journal whenever it creates a conversation's observer — which is exactly what opening a conversation does. useRemotePeers treated any event as "a run is in flight", so a model_changed recorded 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 a runId a no-op for the streaming flag instead of a guess.

Behaviour

  • An event whose payload has no runId returns early and leaves streaming untouched — it neither raises nor clears the flag, so a conversation that is running keeps its dot through a settings change.
  • A started prompt needs no guess either: the host's catalogue states the run's status, and isActiveRun already reads it.

Commits

  • fix(desktop): a conversation's settings event is not a run

Verification

  • npm run lint (eslint src/** + shot/** + vite.shot.config.ts, then tsc --noEmit) → clean
  • npx vitest run in desktop/ → 382 files, 5292 tests passed
  • New regression test does not read a conversations settings event as a run in useRemotePeers.test.ts covers both halves: a replayed model_changed must not mark the row active, and a session_name_changed arriving mid-run must not clear a live dot.

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.
@huichen
huichen enabled auto-merge (squash) October 26, 2026 09:17
@huichen
huichen merged commit 4d10fd7 into main Oct 26, 2026
10 checks passed
@huichen
huichen deleted the pr/huichen branch October 26, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant