Repository navigation
Conversation
…run starts When a queued message started while it was being edited, the edit moved into the thread composer without its thread mentions and other context, even though the toast said it was kept. The context stayed behind in an orphaned queued-edit draft. The move now carries all context the prompt still references. A mention the user typed over stays out, and so do chips with no record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Queued-message edits now retain their referenced context when recovered into an empty composer. The change remains within draft recovery, preserves attachment safeguards, and does not automatically submit the recovered content. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…-context # Conflicts: # apps/web/src/components/chat/queuedMessageEdit.test.ts
|
Note Written by Merged current |
|
This PR conflicts with See the conflict window. |
|
Thanks for this. Before a bug fix is taken further, the bug is reproduced on current main, and here it did not appear. I ran your steps in the web app on current main (5f29d87). The active turn was held on a command approval, one message was queued behind it, and I opened Edit queued message with the normal composer empty. I added an @ mention of another thread, selected the chip and typed over it while keeping the rest of the edited text, then approved the turn so the queued run started before I saved. The composer had already dropped the removed mention's thread record when I typed over the chip, so there was nothing stale left to carry over. After approval, the composer said the unsaved edit was kept. The recovered draft held the edited text with no thread records, and the edit draft was cleared. I also tried two mentions, deleting one with Backspace and keeping the other: the recovered draft kept the prompt with the remaining chip and only that one record. I couldn't find a way in the app to end up with a mention chip that has no record behind it, and the screening on this PR didn't find one either. So I can't reproduce the remaining difference this PR targets on main. If you have a sequence in the app that leaves a stale or orphaned mention after a queued edit is recovered, please share it and we'll take another look. Closing this pull request. If it still happens for you, please open an issue with the exact steps, what you see, and the version and platform you are on; a fix is picked up from there. |
Problem
If a queued message starts while you are editing it, because the turn ended or another client started it, T3 Code moves your unsaved edit into the composer and says "Your unsaved edit was kept in the composer."
On web and desktop, that move carried only the prompt, images and files. Thread mentions and other context stayed behind in an orphaned
queued-edit:draft, and their chips were stripped from the text. If you then sent the message, the agent never got that context. Expected: the whole edit is kept, as on mobile, whereexitQueuedRunEditalready moves context.Steps: hold a turn on an approval, queue a message, click Edit queued message, add an
@threadmention, then approve so the queued message starts mid-edit.Change
moveComposerPromptAndImagesbecomesmoveComposerContent(recoverQueuedMessageEditis its only caller). It now moves every context type the prompt still references, and clears them from the source, so the edit draft goes away.referencedThreadContextson the send path.Scope and approval
No prior issue or discussion. This is a small, focused fix for an obvious bug: the toast says the edit was kept while part of it is dropped, and mobile already keeps it. It solves that one problem in one web store action, with no contract, server or settings changes.
Related open PRs, which I left out of this one:
Verification
Real app with the Replay provider, using the steps above. Both builds show the "kept" toast; only the fixed one still has the mention.
mainthreadContexts: 0threadContexts: 1queued-edit:draftthreadContexts: 1Two cases in
queuedMessageEdit.test.ts, both failed before their fix:With the fix:
queuedMessageEdit.test.tsandcomposerDraftStore.test.ts: 83 passeduseQueuedRunEdit.browser.test.tsx: 7 passedvp run check:changed: all steps passNot checked: the real run used
@threadonly, so the other context types go through the same code but were not each run in the app. Mobile is unchanged and was not run.Model: Claude Opus 5.5, harness: Claude Code in wisp.
🤖 Generated with Claude Code