diff --git a/src/core/assistant-message/presentAssistantMessage.ts b/src/core/assistant-message/presentAssistantMessage.ts index ee3fa148b4..55aba57a92 100644 --- a/src/core/assistant-message/presentAssistantMessage.ts +++ b/src/core/assistant-message/presentAssistantMessage.ts @@ -527,13 +527,9 @@ export async function presentAssistantMessage(cline: Task) { break } - const recentlyModifiedFiles = cline.fileContextTracker.getAndClearCheckpointPossibleFile() - - if (recentlyModifiedFiles.length > 0) { - // TODO: We can track what file changes were made and only - // checkpoint those files, this will be save storage. - await checkpointSave(cline) - } + // Save checkpoint after every message, not just when files are modified + // This ensures user's manual edits between messages are preserved + await checkpointSave(cline) // Seeing out of bounds is fine, it means that the next too call is being // built up and ready to add to assistantMessageContent to present. diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 53b8ef5b87..fb30dc1ef3 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1245,6 +1245,9 @@ export class Task extends EventEmitter { await this.addToApiConversationHistory({ role: "user", content: finalUserContent }) TelemetryService.instance.captureConversationMessage(this.taskId, "user") + // Save checkpoint after user message to preserve any manual edits + await checkpointSave(this) + // Since we sent off a placeholder api_req_started message to update the // webview while waiting to actually start the API request (to load // potential details for example), we need to update the text of that