Fix agent close persistence, whitespace diff filtering, and diff param cleanup

- Persist snapshot before emitting closed agent to avoid data loss
- Flush after branch rename so state hits disk immediately
- Filter phantom whitespace-only files from ignore-whitespace diffs
- Only include ignoreWhitespace param when true to keep payloads clean
- Add createFeature test helper for AgentFeature construction
This commit is contained in:
Mohamed Boudra
2026-04-10 09:50:46 +07:00
parent e6dec3fc1a
commit 4215120d7c
5 changed files with 34 additions and 7 deletions
+10
View File
@@ -1547,6 +1547,16 @@ export async function getCheckoutDiff(
continue;
}
// `git diff -w --name-status` can still surface paths whose only changes were
// whitespace. Skip those empty tracked entries so callers don't see phantom files.
if (
ignoreWhitespace &&
change.status.startsWith("M") &&
(!stat || (!stat.isBinary && stat.additions === 0 && stat.deletions === 0))
) {
continue;
}
structured.push({
path: change.path,
isNew: change.isNew,