From 9f6ad835308ff813fa097e8c722255584832b254 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 31 Aug 2026 22:20:31 +0000 Subject: [PATCH] test(memory-ingest): fence regression test survives Windows tmpdirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wave polish on the #2699 absorption: the hand-built JSONL interpolated the raw tmpdir into a JSON string — on Windows (D:\a\...) that's an invalid escape, the user line was silently dropped, and the body started at '## Assistant' (Windows Free Tests red). JSON.stringify the path. Co-Authored-By: Claude Fable 5 --- test/regression-transcript-frontmatter-fence.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/regression-transcript-frontmatter-fence.test.ts b/test/regression-transcript-frontmatter-fence.test.ts index f4104c5e0..f84ec2493 100644 --- a/test/regression-transcript-frontmatter-fence.test.ts +++ b/test/regression-transcript-frontmatter-fence.test.ts @@ -32,7 +32,10 @@ describe("regression: transcript frontmatter fence terminates its own line", () // colon-bearing line — exactly what the old glued fence swept into YAML. const content = `{"type":"user","message":{"role":"user","content":"before rule\\n\\n---\\n\\nnot: valid: yaml: here"},` + - `"timestamp":"2026-05-01T00:00:00Z","cwd":"${dir}"}\n` + + // JSON.stringify, not raw interpolation: a Windows tmpdir (D:\a\...) + // pasted into hand-built JSON is an invalid escape, the user line gets + // dropped, and the body starts at "## Assistant" (Windows CI red). + `"timestamp":"2026-05-01T00:00:00Z","cwd":${JSON.stringify(dir)}}\n` + `{"type":"assistant","message":{"role":"assistant","content":"ok"},"timestamp":"2026-05-01T00:00:01Z"}\n`; writeFileSync(file, content, "utf-8");