fix(coding-agent): unify compaction UI events closes #2617

This commit is contained in:
Mario Zechner
2026-03-27 03:14:24 +01:00
parent 1ba899f6a6
commit 161ad18287
9 changed files with 233 additions and 105 deletions

View File

@@ -153,10 +153,10 @@ describe("AgentSession auto-compaction queue resume", () => {
)
.mockResolvedValue();
const events: Array<{ type: string; errorMessage?: string }> = [];
const events: Array<{ type: string; reason: string; errorMessage?: string }> = [];
session.subscribe((event) => {
if (event.type === "auto_compaction_end") {
events.push({ type: event.type, errorMessage: event.errorMessage });
if (event.type === "compaction_end") {
events.push({ type: event.type, reason: event.reason, errorMessage: event.errorMessage });
}
});
@@ -171,7 +171,8 @@ describe("AgentSession auto-compaction queue resume", () => {
expect(runAutoCompactionSpy).toHaveBeenCalledTimes(1);
expect(events).toContainEqual({
type: "auto_compaction_end",
type: "compaction_end",
reason: "overflow",
errorMessage:
"Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.",
});