diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 851df91e6c..098234962e 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1219,6 +1219,11 @@ export class Task extends EventEmitter implements TaskLike { // Task starting + // Create a checkpoint at task start to allow reverting to the beginning + // Use allowEmpty=true to ensure checkpoint is created even with no file changes + // Suppress the checkpoint_saved chat row to keep the timeline clean + await this.checkpointSave(true, true) + await this.initiateTaskLoop([ { type: "text", diff --git a/src/core/tools/attemptCompletionTool.ts b/src/core/tools/attemptCompletionTool.ts index 5074d7f4e8..f456751acc 100644 --- a/src/core/tools/attemptCompletionTool.ts +++ b/src/core/tools/attemptCompletionTool.ts @@ -89,6 +89,11 @@ export async function attemptCompletionTool( cline.consecutiveMistakeCount = 0 + // Create a checkpoint when task is completed + // Use allowEmpty=true to ensure checkpoint is created even with no file changes + // Suppress the checkpoint_saved chat row to keep the timeline clean + await cline.checkpointSave(true, true) + // Command execution is permanently disabled in attempt_completion // Users must use execute_command tool separately before attempt_completion await cline.say("completion_result", result, undefined, false) diff --git a/src/core/tools/switchModeTool.ts b/src/core/tools/switchModeTool.ts index 8ce906b41f..5ccf6000bd 100644 --- a/src/core/tools/switchModeTool.ts +++ b/src/core/tools/switchModeTool.ts @@ -61,6 +61,11 @@ export async function switchModeTool( return } + // Create a checkpoint before switching modes + // Use allowEmpty=true to ensure checkpoint is created even with no file changes + // Suppress the checkpoint_saved chat row to keep the timeline clean + await cline.checkpointSave(true, true) + // Switch the mode using shared handler await cline.providerRef.deref()?.handleModeSwitch(mode_slug)