From 20b557ac2f5380d576f8f1c65f48d428ee07408d Mon Sep 17 00:00:00 2001 From: Roo Code Date: Mon, 12 Jan 2026 02:39:28 +0000 Subject: [PATCH] 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 --- src/core/tools/NewTaskTool.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/tools/NewTaskTool.ts b/src/core/tools/NewTaskTool.ts index c5607d2a85..b87a77f27a 100644 --- a/src/core/tools/NewTaskTool.ts +++ b/src/core/tools/NewTaskTool.ts @@ -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,