fix(coding-agent): restore compaction summary and dedupe edit errors

This commit is contained in:
Mario Zechner
2026-03-27 04:00:21 +01:00
parent a0734bd162
commit f456a7a4db
4 changed files with 28 additions and 4 deletions

View File

@@ -215,7 +215,14 @@ function formatEditResult(
.filter((c) => c.type === "text")
.map((c) => c.text || "")
.join("\n");
return errorText ? `\n${theme.fg("error", errorText)}` : undefined;
let previewError: string | undefined;
if (state.preview && "error" in state.preview) {
previewError = state.preview.error;
}
if (!errorText || errorText === previewError) {
return undefined;
}
return `\n${theme.fg("error", errorText)}`;
}
const previewDiff = state.preview && !("error" in state.preview) ? state.preview.diff : undefined;