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
+9 -4
View File
@@ -2226,15 +2226,20 @@ export class DaemonClient {
baseRef?: string;
ignoreWhitespace?: boolean;
}): { mode: "uncommitted" | "base"; baseRef?: string; ignoreWhitespace?: boolean } {
const ignoreWhitespace = compare.ignoreWhitespace === true;
if (compare.mode === "uncommitted") {
return { mode: "uncommitted", ignoreWhitespace };
return compare.ignoreWhitespace === true
? { mode: "uncommitted", ignoreWhitespace: true }
: { mode: "uncommitted" };
}
const trimmedBaseRef = compare.baseRef?.trim();
if (!trimmedBaseRef) {
return { mode: "base", ignoreWhitespace };
return compare.ignoreWhitespace === true
? { mode: "base", ignoreWhitespace: true }
: { mode: "base" };
}
return { mode: "base", baseRef: trimmedBaseRef, ignoreWhitespace };
return compare.ignoreWhitespace === true
? { mode: "base", baseRef: trimmedBaseRef, ignoreWhitespace: true }
: { mode: "base", baseRef: trimmedBaseRef };
}
async getCheckoutDiff(