-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Problem Description
Currently, RooCode has the ability to rollback tasks and file states to specified positions using checkpoints, and also supports deleting user messages to rollback task states. However, this rollback approach requires users to perform two separate operations to restore both task state and file state simultaneously, which is not convenient for the user experience.
Current Behavior:
- Users need to first delete messages to rollback task state
- Then manually use checkpoints to restore file state
- Two independent operations increase operational complexity
Expected Behavior:
- One-click simultaneous rollback of both task state and file state to specified message node
- Add view diff and restore buttons for API request messages
- Support message editing and resending
- Support task forking functionality
Specific Feature Requirements
1. Enhanced User Message Deletion Dialog
Add a new button in the existing deletion confirmation dialog: Delete Subsequent Messages and Restore File State
- Function: Delete specified user message and all subsequent messages, while restoring file state to the first checkpoint after that message
- Implementation: Extend existing `removeMessagesThisAndSubsequent` function to integrate checkpoint restore logic
2. API Request Message Action Buttons
Add two icon buttons for API request messages:
- View Diff Button: Only shown when checkpoint exists after API request message, click effect equivalent to clicking view diff of the next checkpoint
- Restore Button: Restore task state to before sending request, if checkpoint exists after API request then also restore file state
3. User Message Edit Functionality
Add Edit Button for user messages:
- Allow users to directly edit specified message content
- Automatically rollback task and files to specified time point when resending
- Resend with edited content
4. Enhancement Diff
- Diff View After attempt_completion
- Automatically create checkpoint when `attempt_completion` is called
- Add button: View diff from first checkpoint to current
- Help users understand file changes throughout the entire task process
- Add Full Diff View
The current diff is to compare the selected checkpoint with the next checkpoint. A new view difference (compare with workspace) should be added. This helps users to view all changes from the selected checkpoint to the current workspace.
5. User Message Fork Functionality
Add Fork Button for user messages:
- Allow users to create new task branch from specified message node
- Copy task state to specified time point, including related checkpoints
- Automatically switch to newly created task
Technical Implementation Analysis
Based on code analysis, relevant core components include:
Existing Implementation
- Message Deletion: `webviewMessageHandler.ts:87-139` `removeMessagesThisAndSubsequent`
- Message Editing: `webviewMessageHandler.ts:142-193` edit handling logic
- Checkpoint System: `ShadowCheckpointService.ts:244-269` save and restore
- Checkpoint Restore: `checkpoints/index.ts:186-243` `checkpointRestore`
Components Requiring Modification
- WebView Message Handling: Extend message types in `webviewMessageHandler.ts`
- UI Components: Modify message action buttons in `ChatRow.tsx`
- Checkpoint Service: May need to extend checkpoint querying and diff comparison functionality
- Task Management: Extend task copying logic for Fork functionality
User Impact
Benefiting Users:
- All users using RooCode for iterative development
- Users who need frequent rollbacks and adjustments
- Users performing complex task management
Use Cases:
- When AI responses are unsatisfactory, quickly rollback to previous state and retry
- Need to return to specific node in long conversations to continue
- Need to create different solution branches from a certain node
- View file change history throughout entire task process
Related Links
Related Issue reference:
- Add message editing functionality to chat interface #4703
- Add checkpoint after every message. #5995
- Create a new conversation based on the specified message #5986
Related PR reference: - Edit/Delete with Checkpoints #5710
- feat: Show checkpoint button on all subsequent messages #6273
Related discussion: - Fork/Clone Chat Feature. #2943
Checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear impact and context" --label "proposal,enhancement"
Metadata
Metadata
Assignees
Labels
Type
Projects
Status