Menu
popagent
publicLatest change 7f0ff66d6d9fb6468416c58bee46bd3d08169501 - Checkpoint browser channels and memory work by AkurAI Build
import { beforeAll, describe, expect, test } from "bun:test";
import { MemorySettingsStore } from "./memory-settings";
const store = new MemorySettingsStore();
beforeAll(() => store.init());
describe("MemorySettingsStore", () => {
test("persists conversation compaction settings", async () => {
const original = await store.get();
const input = {
autoCompact: !original.autoCompact,
observationTokens: 24_000,
reflectionTokens: 48_000,
recentMessagePercent: 25,
asyncBuffering: false,
bufferIntervalPercent: 25,
bufferOnIdle: false,
observationBlockPercent: 130,
reflectionBufferPercent: 60,
reflectionBlockPercent: 140,
optimizeObserverContext: true,
previousObserverTokens: 3_000,
retrievalEnabled: true,
retrievalScope: "thread" as const,
temporalMarkers: true,
activateAfterIdle: "5m" as const,
activateOnProviderChange: true,
shareTokenBudget: true,
observeAttachments: "auto" as const,
observationInstruction: "Keep exact project decisions.",
reflectionInstruction: "Preserve dates and unresolved blockers.",
};
try {
expect(await store.update(input)).toMatchObject(input);
expect(await new MemorySettingsStore().get()).toMatchObject(input);
} finally {
await store.update(original);
}
});
});