Skip to content

fix(server): a queued message stays visible after a restart cuts its turn short - #41292

Closed
EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/cancelled-started-queued-message
Closed

EtanHey wants to merge 1 commit into
pingdotgg:mainfrom
EtanHey:fix/cancelled-started-queued-message

Conversation

@EtanHey

@EtanHey EtanHey commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

🤖 Claude (Opus 5.5) on behalf of Etan

Fixes #41290.

Problem

A server restart marks a run that already started as cancelled. The visibility rule hides every queued_turn message of a cancelled run, so a message the provider had already received disappears from the timeline, t3_thread_read, history pages, the shell item count and search after a desktop update.

Change

A cancelled run hides its queued message only if it never started (startedAt === null). That is the server's existing definition of withdrawn queued input (see the last-executed-run index). The same condition goes into each copy of the rule: orchestrationV2Timeline.ts, plus the SQL in ProjectionStore.ts (hidden-row lookup, snapshot window, both shell counts) and ThreadSearch.ts. The shell counts read startedAt through a separate primary-key lookup, so their status lookups stay covering. Fork inheritance is unchanged.

Scope and approval

Bug fix, reported in #41290.

Verification

  • Fail-first tests: each fails on main and passes here.
    • orchestrationV2Timeline.test.ts: point and indexed checks.
    • ProjectionStore.test.ts: timeline page, projection, snapshot window and shell counts.
    • ThreadSearch.test.ts.
  • On the affected thread's real rows, the shared rule from 0.1.12-nightly.20261123.5124 hides the message and this branch shows it. No other row changes.
  • vp run check:changed: lint, knip, typecheck and the affected tests pass.
  • Not checked: a live restart mid-turn in a dev build.

🤖 Generated with Claude Code

…tarted run short

A server shutdown marks a run that already started as cancelled. The
turn-item visibility rule (and its SQL copies in the snapshot window, the
hidden-row lookup, both shell item counts and thread search) hid every
queued_turn message of a cancelled run, so a message the provider had
already received vanished from the timeline after a restart.

Only a cancelled run that never started withdraws its queued input now.

Fixes pingdotgg#41290

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the vouch:unvouched Author is not yet trusted in the VOUCHED list. label Nov 23, 2026
@EtanHey EtanHey changed the title fix(server): a queued message stays visible when a restart cuts its started run short fix(server): a queued message stays visible after a restart cuts its turn short Nov 23, 2026
@github-actions github-actions Bot added the size:M 30-99 changed lines (additions + deletions). label Nov 23, 2026
@EtanHey

EtanHey commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing: review showed startedAt does not prove delivery. The correct fix needs the provider-turn check in every copy of the visibility rule, which is larger than a small outside fix. Details are in #41290.

🤖 Claude (Opus 5.5) on behalf of Etan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A queued message disappears from the timeline when a server restart cancels its run after it started

1 participant