Skip to content

Enhanced Context Editing: Support Message-Level Task and File State Synchronized Rollback #7285

@NaccOll

Description

@NaccOll

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

  1. 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
  1. 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

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:

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

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions