Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 12, 2026

Related GitHub Issue

Closes: #10623

Roo Code Task Context (Optional)

This PR was created by Roo Code to address the issue regarding checkpoints in Orchestrator mode.

Description

This PR addresses the enhancement request to make checkpoints visible in Orchestrator mode when delegating to subtasks.

The Issue:
Checkpoints were not appearing in the Orchestrator mode conversation before subtask delegation because the checkpointSave() call was not awaited. This caused a race condition where the subtask delegation could happen before the checkpoint message was added to the conversation history.

The Fix:
Added await to the checkpointSave(true) call in NewTaskTool.ts to ensure the checkpoint is fully saved and the checkpoint message appears in the conversation history BEFORE the subtask delegation occurs.

How this helps users:

  • Users can now see checkpoint entries before subtask delegation in Orchestrator mode
  • Users can use "Restore Files" to restore just the file state before the subtask
  • Users can use "Restore Files and Task" to restore both files AND conversation state, effectively removing the subtask conversation and allowing them to take a different approach

Test Procedure

  1. Start a task in Orchestrator mode
  2. Let the orchestrator delegate to a subtask using the new_task tool
  3. Verify that a checkpoint entry appears in the conversation BEFORE the newTask tool block
  4. Test the checkpoint menu options:
    • "View Diff" should show any file changes since the last checkpoint
    • "Restore Files" should restore file state to before the subtask
    • "Restore Files and Task" should restore both files and remove the subtask conversation

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable). Tests will be run by CI.
  • Documentation Impact: No documentation updates are required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

The change is minimal - adding a single await keyword to ensure proper sequencing of the checkpoint save and subtask delegation. The existing checkpoint functionality already supports:

  • Viewing diffs between checkpoints
  • Restoring files only (preview mode)
  • Restoring files and conversation state (restore mode)

By ensuring the checkpoint is visible before subtask delegation, users can now leverage these existing features to:

  1. See what file changes occurred before delegation
  2. Restore to the pre-delegation state if the subtask approach is not working
  3. Try a different approach by restoring and providing different instructions

Get in Touch

This PR was created by an automated agent in response to the issue comment.


Important

Adds await to checkpointSave(true) in NewTaskTool.ts to ensure checkpoints are saved before subtask delegation, improving checkpoint visibility in Orchestrator mode.

  • Behavior:
    • Adds await to checkpointSave(true) in NewTaskTool.ts to ensure checkpoints are saved before subtask delegation.
    • Users can now see checkpoint entries before subtask delegation in Orchestrator mode.
    • Enables users to restore file and conversation states before subtask creation.
  • Misc:

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

…mode

This ensures that the checkpoint message appears in the conversation history
before the newTask tool message, making checkpoints visible to users in
Orchestrator mode when delegating to subtasks.

Fixes #10623
@roomote
Copy link
Contributor Author

roomote bot commented Jan 12, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The change correctly adds await to checkpointSave(true) to ensure the checkpoint message appears in conversation history before subtask delegation. This follows the established pattern used elsewhere in the codebase.

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 Jan 12, 2026
@mdziekon
Copy link

@roomote

I can confirm that with this change Checkpoints in the Orchestrator mode are now visible and seem to function correctly - I was able to prompt a subtask creation, and once that subtask has finished and went back to the parent task, I was able to click on the "Restore Checkpoint" button to restore to version from before the subtask has started working.

One thing I've noticed, is that the Checkpoint appears between the "Subtask Instructions" session entry and the "Subtask Results" section, which is a bit counterintuitive to me (but that might be subjective opinion).

Another thing I've noticed is that if I use "Restore Checkpoint" and resume the main task, Agent started "thinking" again and create a new subtask. However, that subtask was much less detailed than the first one, which might lead to problems I assume. If one wants to just "restart" a task, this can be alleviated somewhat by writing a User message saying that the exact same subtask should be created, but I feel like this might need a bit more UX polish. However, that might be something some the maintainers to think about, regardless of whether this needs to be changed now, or in the future.

@roomote
Copy link
Contributor Author

roomote bot commented Jan 12, 2026

Fixaroo Clock   See task on Roo Cloud

Thanks for testing and confirming the fix works! No code changes needed based on your feedback.

Regarding checkpoint position: The current behavior is by design per the issue requirements. The checkpoint is created "right before the subtask starts working" - which means after the instructions are given (as part of the new_task tool call) but before the subtask actually executes. This allows users to restore to the exact state before any subtask work began.

Regarding subtask detail after restore: This is expected behavior. When you restore to a checkpoint, the conversation state is restored to that point, so the agent makes fresh decisions without the context of what happened in the previous subtask. Your suggestion to add a user message with specific instructions is a good workaround.

Both UX suggestions have been noted for maintainers to consider in future iterations.

@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jan 12, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 12, 2026
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: Done

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add Checkpoints in the Orchestrator mode

4 participants