fix(coding-agent): unify compaction UI events closes #2617
This commit is contained in:
@@ -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.",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user