fix: hide system-reminder blocks in backfill + literal tag rendering (#935)

This commit is contained in:
Charles Packer
2026-02-12 14:27:49 -08:00
committed by GitHub
parent 28e67dadae
commit fa783fd2c8
4 changed files with 120 additions and 69 deletions

View File

@@ -0,0 +1,21 @@
import { describe, expect, test } from "bun:test";
import { splitSystemReminderBlocks } from "../../cli/components/UserMessageRich";
describe("splitSystemReminderBlocks", () => {
test("treats unmatched system-reminder opener as literal user text", () => {
const text = "like the <system-reminder> etc included.";
const blocks = splitSystemReminderBlocks(text);
expect(blocks).toEqual([{ text, isSystemReminder: false }]);
});
test("still detects well-formed system-reminder blocks", () => {
const blocks = splitSystemReminderBlocks(
"before\n<system-reminder>\ncontext\n</system-reminder>\nafter",
);
expect(blocks.some((b) => b.isSystemReminder)).toBe(true);
expect(blocks.some((b) => b.text.includes("before"))).toBe(true);
expect(blocks.some((b) => b.text.includes("after"))).toBe(true);
});
});