Repository navigation
fix(host): ignore model system snapshot when retracting a stopped prompt - #2398
Merged
Merged
Conversation
Every turn persists an empty system row carrying the model system snapshot right after the user prompt. substantive_reply treated any non-assistant row as a started reply, so stopping before the model produced output always failed with reply_started and the composer showed "could not safely restore the draft". The snapshot is request state, not reply content, so it no longer blocks retraction; it is removed together with the stopped turn.
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.
Stopping a turn before any reply always showed "could not safely restore the draft": the per-turn empty system row carrying the model system snapshot was counted as a started reply (
reply_started), sosession.retractPendingPromptrefused.The snapshot row is now treated as request state and removed with the stopped turn. Text, thinking and tool rows still block retraction.
Tests: new red/green regression test
retract_ignores_the_turn_model_system_snapshot;cargo fmt --check;cargo test -p host-core(2 unrelated local-environment failures: installed-app plugin listing, review path classification).