Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 30, 2025

This PR attempts to address Issue #10402. Feedback and guidance are welcome.

Problem

When using checkpoint restore, the tasks appear to be restored, but the UI does not update properly. This happens because the restored tasks are re-executed (auto-resumed) instead of just displaying the restored state.

Root Cause

The issue occurs in the checkpoint restore flow:

  1. checkpointRestore() calls provider?.cancelTask() after completing the restore
  2. cancelTask() calls createTaskWithHistoryItem() with default startTask: true
  3. This causes the task to auto-resume and re-execute its message history

Solution

Pass startTask: false through the checkpoint restore flow to prevent auto-resumption:

  • Modified ClineProvider.cancelTask() to accept optional { startTask?: boolean } parameter
  • Updated checkpointRestore() to pass { startTask: false } to cancelTask()
  • Updated handleCheckpointRestoreOperation() delete operation to pass { startTask: false } to createTaskWithHistoryItem()

Test Plan

  • Verified all existing checkpoint tests pass
  • Verified all checkpointRestoreHandler tests pass
  • TypeScript type checking passes

Verification

To verify this fix:

  1. Create a task with checkpoint enabled
  2. Make some progress and create multiple checkpoints
  3. Use checkpoint restore (either "Restore files" or "Restore files & tasks")
  4. Confirm the UI displays the restored state without re-executing the tasks

- Modified ClineProvider.cancelTask() to accept optional startTask parameter
- Updated checkpointRestore() to pass startTask: false to cancelTask()
- Updated checkpointRestoreHandler delete operation to pass startTask: false to createTaskWithHistoryItem()
- Updated tests to reflect the new behavior

This fixes the issue where checkpoint restore would re-execute
restored tasks instead of just displaying the restored state.

Fixes #10402
@roomote
Copy link
Contributor Author

roomote bot commented Dec 30, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly addresses the root cause: checkpoint restore was causing tasks to auto-resume and re-execute message history. The fix adds an optional startTask parameter to cancelTask() that defaults to true for backward compatibility, while passing false in checkpoint restore flows to prevent auto-resumption.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

3 participants