Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 30, 2025

Summary

Fixes issue #5173 where checkpoints functionality disappeared in Roo Code version 3.20.1.

Problem

The checkpoint system was saving checkpoints AFTER tool execution instead of BEFORE, which meant:

  • No initial checkpoint was created before the first modification
  • Each checkpoint captured the state AFTER changes, not before
  • Users couldn't revert to the state before changes were made

Solution

  • Moved checkpoint saving logic to occur before file-modifying tools are executed (lines 411-414)
  • Removed old logic that saved checkpoints after tool execution (lines 524-530)
  • Identified file-modifying tools: write_to_file, apply_diff, insert_content, search_and_replace

Changes

  • Modified src/core/assistant-message/presentAssistantMessage.ts
  • Added checkpoint saving before tool execution for file-modifying tools
  • Removed checkpoint saving after tool execution

Testing

  • Existing checkpoint tests continue to pass
  • The fix ensures checkpoints capture workspace state before modifications
  • Restores the expected checkpoint functionality for version comparison and rollback

Impact

This restores the checkpoint functionality that users relied on in version 3.19.6, allowing them to:

  • Compare versions before and after changes
  • Roll back changes when needed
  • Have confidence that their work is properly tracked

Closes #5173


Important

Move checkpoint saving to occur before file-modifying tools in presentAssistantMessage, restoring expected functionality for version comparison and rollback.

  • Behavior:
    • Move checkpoint saving logic to occur before file-modifying tools are executed in presentAssistantMessage.
    • Remove old logic that saved checkpoints after tool execution.
  • Tools:
    • Identified file-modifying tools: write_to_file, apply_diff, insert_content, search_and_replace.
  • Testing:
    • Existing checkpoint tests continue to pass, ensuring checkpoints capture workspace state before modifications.

This description was created by Ellipsis for 5a9c9f0. You can customize this summary. It will automatically update as commits are pushed.

- Move checkpoint saving logic to occur before file-modifying tools are executed
- This ensures checkpoints capture the workspace state before changes are made
- Remove old logic that saved checkpoints after tool execution
- Fixes issue where checkpoints were not being created before code modifications
- Restores ability to compare versions and roll back changes as expected
@roomote roomote requested review from cte, jr and mrubens as code owners June 30, 2025 07:50
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jun 30, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jun 30, 2025

No security or compliance issues detected. Reviewed everything up to 5a9c9f0.

Security Overview
  • 🔎 Scanned files: 1 changed file(s)
Detected Code Changes

The diff is too large to display a summary of code changes.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

// Save checkpoint before any file-modifying tool is executed
const fileModifyingTools = ["write_to_file", "apply_diff", "insert_content", "search_and_replace"]
if (fileModifyingTools.includes(block.name)) {
await checkpointSave(cline)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checkpoint is now saved before executing file-modifying tools. Consider wrapping 'await checkpointSave(cline)' in a try/catch block to ensure that a failure in saving a checkpoint doesn't halt tool execution.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 30, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 7, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Checkpoints functionality has disappeared

3 participants