fix(web): restore reverted messages to composer - #6044
amitray007 wants to merge 7 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1ea7561 to
7595b96
Compare
ApprovabilityVerdict: Needs human review This PR introduces a new feature for restoring reverted messages to the composer, including attachment fetching, draft stashing, and complex state management. Despite the 'fix' prefix, the ~670 lines of additions represent significant new user-facing capability that warrants human review. You can customize Macroscope's approvability policy. Learn more. |
7595b96 to
e78c60f
Compare
e78c60f to
50b09fb
Compare
176cb9f to
813cdec
Compare
813cdec to
578d132
Compare
578d132 to
ad77987
Compare
4e9ba03 to
af4d491
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit af4d49122a15121bd56b5a385e0d64db176d5ecd. Configure here.
af4d491 to
e363cd4
Compare
e363cd4 to
a216c72
Compare
|
Won't be able to maintain this PR anymore. Feel free to use the code if needed, using a personal fork going forward. |

What Changed
Reverted user messages now return to the composer with their images. If a draft is already present, it is saved to Stash first.
The live timeline also removes the reverted message once the server confirms the rewind.
Why
“Revert to this message” rewound the checkpoint, but left the selected message in the timeline and forced users to recreate the prompt before sending it again.
Closes #5685
UI Changes
Interaction
bettershot_1786392103024.mp4
Checklist
Built with GPT-5.6-Sol through T3 Code.
Note
Restore reverted user message prompt and attachments into the composer
deriveRevertedMessageContentstrips review comment blocks and preview-annotation screenshots from the prompt before restoration;fetchRevertedMessageAttachmentBlobfetches attachment blobs with a 10-second abort timeout.PROVIDER_SEND_TURN_MAX_ATTACHMENTS, and any existing stash or context attachments are cleared before writing.threadReduceris now bounded by the latest retained checkpoint instead of keeping all turnless messages unconditionally.Macroscope summarized a216c72.
Note
Medium Risk
Touches checkpoint revert UX and client-side message retention after
thread.reverted, plus blob URL lifecycle for restored attachments. Failures are mostly soft (toasts / unavailable images), but incorrect retention or cleanup would affect timeline correctness and composer state.Overview
Reverting a checkpoint now puts the selected user message back into the composer (editable text + images), so users can edit and resend instead of recreating the prompt.
Existing draft text/images are stashed first when possible; session-bound context (terminal/element/preview/review) is cleared because it cannot be safely reused after a rewind. Preview-annotation screenshots and review/context blocks are stripped from the restored prompt. Attachment blobs are fetched with a 10s abort timeout, deduped, and capped at the composer image limit, with toasts for missing/overflow images and stash/clear outcomes.
Separately,
retainMessagesAfterRevertnow drops turnless messages after the latest retained checkpoint, so the timeline actually removes the reverted prompt once the server confirms the rewind.Reviewed by Cursor Bugbot for commit a216c72. Bugbot is set up for automated code reviews on this repo. Configure here.