fix(active-memory): stabilize timeout partial recovery

This commit is contained in:
Vincent Koc
2026-05-04 13:31:34 -07:00
parent 4820b701a5
commit 59b5058cdb
3 changed files with 3 additions and 2 deletions

View File

@@ -3283,7 +3283,6 @@ describe("active-memory plugin", () => {
`^${escapeRegExp(expectedDir)}${escapeRegExp(path.sep)}active-memory-[a-z0-9]+-[a-f0-9]{8}\\.jsonl$`,
),
);
expect(rmSpy).not.toHaveBeenCalled();
expect(
vi
.mocked(api.logger.info)
@@ -3291,6 +3290,7 @@ describe("active-memory plugin", () => {
String(call[0]).includes(`transcript=${expectedDir}${path.sep}`),
),
).toBe(true);
expect(rmSpy.mock.calls.some(([target]) => String(target).startsWith(expectedDir))).toBe(false);
});
it("falls back to the default transcript directory when transcriptDir is unsafe", async () => {

View File

@@ -45,7 +45,7 @@ const TOGGLE_STATE_FILE = "session-toggles.json";
const DEFAULT_PARTIAL_TRANSCRIPT_MAX_CHARS = 32_000;
const DEFAULT_TRANSCRIPT_READ_MAX_LINES = 2_000;
const DEFAULT_TRANSCRIPT_READ_MAX_BYTES = 50 * 1024 * 1024;
const TIMEOUT_PARTIAL_DATA_GRACE_MS = 50;
const TIMEOUT_PARTIAL_DATA_GRACE_MS = 500;
const MAX_ACTIVE_MEMORY_SEARCH_QUERY_CHARS = 480;
const TERMINAL_MEMORY_SEARCH_POLL_INTERVAL_MS = 25;