Repository navigation
fix(server): do not send a prompt stopped while it is prepared - #422
Open
cursor[bot] wants to merge 1 commit into
Open
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
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>
This branch has not been deployed
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 Changed
A Stop that arrives while a provider is still preparing a prompt is not written.
interruptwith 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
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, andcargo clippy -p bibcode-server --lib --no-deps --offline -- -D warnings.vp checkandvp run typecheckwere 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.