Skip to content

fix(composer): preserve newer drafts after command completion - #934

Merged
vastsa merged 3 commits into
vastsa:mainfrom
yuxino:fix/composer-command-draft-preservation
Sep 23, 2026
Merged

vastsa merged 3 commits into
vastsa:mainfrom
yuxino:fix/composer-command-draft-preservation

Conversation

@yuxino

@yuxino yuxino commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Running /compact and writing the next message while it finishes currently erases the new draft. Command completion now clears only the submitted text and attachments; edits made while waiting survive, including after switching sessions. An unchanged command draft still clears normally.

Before/after recording (1920 × 1440, real desktop app; local model with controlled response timing):

compact-draft-before-after-hd.mp4

The fix is confined to two composer hooks, with regression coverage and matching English/Chinese specs. The regression fails on the original code and passes with the fix for new text, added images, session switching, and unchanged drafts.

Validation: composer interaction suite, 22 focused tests, JS build, desktop typecheck, lint, and docs checks passed. The real macOS desktop reproduction uses isolated data and a local model with a controlled response delay.

Candidate validation

Base: 454715877750 (0.15.6). Candidate: 559c01b4d.

pnpm test:e2e:composer-paste passed on the committed candidate. The desktop recording uses the real renderer, preload, Electron main, Host and agent runtime; only the model service is a local fixture.

yuxino and others added 3 commits September 23, 2026 14:52
Only clear a completed command draft when its text and attachments still
match the submitted snapshot. This keeps a new message typed during
compaction available, including after the user switches sessions.
@vastsa
vastsa merged commit a634b68 into vastsa:main Sep 23, 2026
4 checks passed
vastsa added a commit that referenced this pull request Sep 26, 2026
Refresh the plugin UI slot branch before continuing the slot work so
the composer changes build on the draft-revision guard from #934 and
the rest of main instead of a stale base.
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.

2 participants