Report disabled CLI compaction as not compacted

This commit is contained in:
Robin Newhouse
2026-06-26 19:03:02 -07:00
parent daae08f5d5
commit a6e06b9511
2 changed files with 9 additions and 3 deletions
@@ -387,8 +387,7 @@ describe("createInteractiveSessionRuntime", () => {
expect(result).toEqual({
messagesBefore: messages.length,
messagesAfter: messages.length,
workingContextMessagesAfter: compactionState.messages.length,
compacted: true,
compacted: false,
});
expect(manager.updateSessionCompactionState).not.toHaveBeenCalled();
expect(runtime.getActiveSessionId()).toBe(sessionId);
@@ -644,7 +644,14 @@ export function createInteractiveSessionRuntime(input: {
const updated = await compactionSidecar.update(() =>
manager.updateSessionCompactionState(sourceSessionId, compactionState),
);
if (!updated.updated && !updated.disabled) {
if (updated.disabled) {
return {
messagesBefore,
messagesAfter: messagesBefore,
compacted: false,
};
}
if (!updated.updated) {
throw new Error("Compaction could not be saved. Try again.");
}
return {