Skip to content

fix(host): ignore model system snapshot when retracting a stopped prompt - #2398

Merged
vastsa merged 1 commit into
mainfrom
fix/retract-prompt-model-system-row
Nov 17, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/retract-prompt-model-system-row

Conversation

@vastsa

@vastsa vastsa commented Nov 17, 2026

Copy link
Copy Markdown
Owner

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), so session.retractPendingPrompt refused.

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).

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.
@vastsa
vastsa merged commit 4d16de7 into main Nov 17, 2026
5 checks passed
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