fix(desktop): discard explicitly aborted turns#1687
Merged
esengine merged 1 commit intoMay 24, 2026
Conversation
Owner
|
Thanks — merged. Cleanly factored: explicit One UX trade-off worth noting for a possible follow-up: the aborted text disappears from session.jsonl on disk, so a reload/session-switch loses what the user typed. A later iteration could surface it back as a composer draft on Abort so the model log still gets cleared but the user can edit + resend without retyping. Not for this PR. |
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.
Summary
Root Cause
Desktop explicit aborts used the same loop abort behavior as session switches. The loop persists the user prompt before the first API call so interrupted sessions remain visible, but for a user-initiated Abort that left the abandoned long edit prompt in history. The next request could then include both the stale interrupted task and the new prompt, making the model treat the user as repeatedly interrupting or narrowing the work.
Fixes #1593
Validation
npm test -- --run tests/loop-user-persist.test.ts tests/loop.test.ts tests/desktop-crash-guards.test.tsnpm test -- --run tests/public-api.test.ts tests/loop-user-persist.test.tsnpx biome check src/loop.ts src/index.ts src/cli/commands/desktop.ts tests/loop-user-persist.test.tsnpm run typechecknpm run verify: 262 test files passed; 3610 tests passed; 12 skipped. Biome reported two existing unused-suppression warnings outside this change.