Skip to content

fix(server): do not send a prompt stopped while it is prepared - #422

Open
cursor[bot] wants to merge 1 commit into
claude/backlog-triage-planning-pr-b5ee7ffrom
fix/stop-during-prompt-prepare
Open

cursor[bot] wants to merge 1 commit into
claude/backlog-triage-planning-pr-b5ee7ffrom
fix/stop-during-prompt-prepare

Conversation

@cursor

@cursor cursor Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

What Changed

A Stop that arrives while a provider is still preparing a prompt is not written. interrupt with no turn id, which is what a Dismiss does after it commits, marks that unsent prompt. Codex, Cursor, Antigravity, Grok, OpenCode, and Claude check the mark after they prepare attachments and before they write.

Why

The web Stop on a thread that is not running yet dismisses the sending row, then interrupts with no turn id. The send fence only re-checks the row before deliver. Drivers then read and encode attachments, and that interrupt found no running turn, so it did nothing. The prompt was still written, and the agent could start work the user had stopped.

Stopping during that preparation now settles the delivery unsent.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

No UI changes.

Validation: cargo test -p bibcode-server --lib --offline -- a_stop_while_a_prompt_is_prepared_is_not_sent a_dismiss_after_the_freeze_before_the_send_sends_nothing a_dismiss_during_the_launch_sends_nothing a_dismiss_after_the_launch_before_deliver_sends_nothing (4 passed), cargo fmt -p bibcode-server -- --check, and cargo clippy -p bibcode-server --lib --no-deps --offline -- -D warnings. vp check and vp run typecheck were not run.

Profiler, crash, and trace coverage: none applies. The stop still goes through the existing driver interrupt and writes no new event.

Testing runbooks were reviewed and remain accurate.

Open in Web View Automation 

A Stop on a message that is still sending dismisses the row, then
interrupts with no turn id. Drivers prepare attachments after the send
fence, and that interrupt found no turn to stop, so the prompt was
written anyway.

The interrupt now marks the unsent prompt, and each driver refuses the
write when that mark arrives during preparation.

Co-authored-by: mauroubeda <mauroubeda@gmail.com>
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Nov 24, 2026

This branch has not been deployed

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

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant