diff --git a/apps/server/src/providerManager.ts b/apps/server/src/providerManager.ts index 532f32f7fa..992e4eef18 100644 --- a/apps/server/src/providerManager.ts +++ b/apps/server/src/providerManager.ts @@ -320,7 +320,7 @@ export class ProviderManager extends EventEmitter { ); } - if (checkpointCwd && input.turnCount > 0) { + if (input.turnCount > 0) { const hasCheckpoint = await this.filesystemCheckpointStore.hasCheckpoint({ cwd: checkpointCwd, threadId: beforeSnapshot.threadId, diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx index 6cf7b61ced..4688d728e5 100644 --- a/apps/web/src/components/DiffPanel.tsx +++ b/apps/web/src/components/DiffPanel.tsx @@ -241,29 +241,8 @@ export default function DiffPanel({ mode = "inline" }: DiffPanelProps) { } // Fallback when a conversation checkpoint diff isn't available yet: - // keep one patch per file path (latest change wins) so files aren't duplicated. - const latestPatchByPath = new Map(); - for (const summary of turnDiffSummaries) { - for (const file of summary.files) { - if (latestPatchByPath.has(file.path)) { - continue; - } - const patch = file.diff?.trim(); - if (!patch) { - continue; - } - latestPatchByPath.set(file.path, patch); - } - } - if (latestPatchByPath.size > 0) { - return Array.from(latestPatchByPath.entries()) - .toSorted(([leftPath], [rightPath]) => - leftPath.localeCompare(rightPath, undefined, { numeric: true, sensitivity: "base" }), - ) - .map(([, patch]) => patch) - .join("\n\n"); - } - + // show each turn's diff (oldest first) via patchForSummary, which prefers + // cached checkpoint diffs when available. const patches = turnDiffSummaries .toReversed() .map((summary) => patchForSummary(summary)?.trim())