fix(coding-agent): preserve compaction queue behavior (#6730)

This commit is contained in:
Danila Poyarkov
2026-07-17 10:09:01 +03:00
committed by GitHub
parent 16afccd346
commit 35a0d5d620
2 changed files with 32 additions and 4 deletions
@@ -56,4 +56,30 @@ describe("InteractiveMode compaction events", () => {
);
expect(fakeThis.flushCompactionQueue).toHaveBeenCalledWith({ willRetry: false });
});
test("preserves steering behavior when flushing into an active agent run", async () => {
const fakeThis = {
compactionQueuedMessages: [{ text: "change direction", mode: "steer" as const }],
session: {
clearQueue: vi.fn(),
prompt: vi.fn().mockResolvedValue(undefined),
steer: vi.fn().mockResolvedValue(undefined),
followUp: vi.fn().mockResolvedValue(undefined),
},
isExtensionCommand: vi.fn().mockReturnValue(false),
updatePendingMessagesDisplay: vi.fn(),
showError: vi.fn(),
};
const flushCompactionQueue = Reflect.get(InteractiveMode.prototype, "flushCompactionQueue") as (
this: typeof fakeThis,
options?: { willRetry?: boolean },
) => Promise<void>;
await flushCompactionQueue.call(fakeThis, { willRetry: false });
expect(fakeThis.session.prompt).toHaveBeenCalledWith("change direction", { streamingBehavior: "steer" });
expect(fakeThis.compactionQueuedMessages).toEqual([]);
expect(fakeThis.showError).not.toHaveBeenCalled();
});
});