fix: await checkpoint save before subtask delegation in Orchestrator 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
This commit is contained in:
Roo Code 2026-01-12 02:39:28 +00:00
parent 632b86cfbe
commit 20b557ac2f

View file

@ -118,11 +118,15 @@ export class NewTaskTool extends BaseTool<"new_task"> {
}
// Provider is guaranteed to be defined here due to earlier check.
// Create a checkpoint before delegating to subtask.
// This allows users to restore to the state before the subtask was created.
// We await this to ensure the checkpoint message appears in the history
// before the delegation happens.
if (task.enableCheckpoints) {
task.checkpointSave(true)
await task.checkpointSave(true)
}
// Delegate parent and open child as sole active task
const child = await (provider as any).delegateParentAndOpenChild({
parentTaskId: task.taskId,