Fix: only set hasTurnDiffUpdate flag when diff payload is non-empty

Move summary.hasTurnDiffUpdate = true inside the if (diff) block so that
an empty or whitespace-only diff from the newest turn/diff/updated event
does not block fallback to older events that may carry valid file metadata.
This commit is contained in:
Cursor Agent committed 2026-02-19 07:18:29 +00:00
1 parent c50b216bbd
commit 77c6ec7b6e
1 file changed
+1 -1
+1 -1
View File
@@ -673,9 +673,9 @@ export function deriveTurnDiffSummaries(events: ProviderEvent[]): TurnDiffSummar
}
if (event.method === "turn/diff/updated" && !summary.hasTurnDiffUpdate) {
summary.hasTurnDiffUpdate = true;
const diff = normalizeDetail(asString(asObject(event.payload)?.diff));
if (diff) {
summary.hasTurnDiffUpdate = true;
for (const file of deriveTurnDiffFilesFromUnifiedDiff(diff)) {
mergeTurnDiffFileChange(summary.filesByPath, file);
}