Compare commits

..
Author SHA1 Message Date
Cursor Agent db3b9e0807 Fix redundant truthiness check and misleading incremental diff fallback
- Remove redundant 'checkpointCwd &&' guard in revertToCheckpoint (providerManager.ts:323)
  since checkpointCwd is guaranteed truthy after the throw on lines 310-313.

- Remove latestPatchByPath deduplication fallback in DiffPanel.tsx that kept only the
  most recent turn's per-file incremental diff, which was misleading for files changed
  across multiple turns. The per-turn patchForSummary fallback (which prefers cached
  checkpoint diffs) now handles the case, showing all turns' changes.
2026-02-19 04:41:38 +00:00
Cursor Agent e29a7705f9 Fix CWD override semantics and greedy regex in diff path parsing
- Restore null CWD in sessionOverrides for thread/start and thread/resume
  so the Codex app server can distinguish 'no override' from an explicit
  path (e.g., to reuse a resumed thread's original CWD).
- Use backreference in diff --git fallback regex to correctly parse paths
  containing ' b/' (e.g., binary diffs without +++ b/ lines).
- Add test exercising the git header fallback for binary diffs with ' b/'
  in the path.

Applied via @cursor push command
2026-02-19 04:19:44 +00:00
2 changed files with 3 additions and 24 deletions

No files matched your search

+1 -1
View File
@@ -320,7 +320,7 @@ export class ProviderManager extends EventEmitter<ProviderManagerEvents> {
);
}
if (checkpointCwd && input.turnCount > 0) {
if (input.turnCount > 0) {
const hasCheckpoint = await this.filesystemCheckpointStore.hasCheckpoint({
cwd: checkpointCwd,
threadId: beforeSnapshot.threadId,
+2 -23
View File
@@ -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<string, string>();
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())