fix: log env opts and collapse duplicate blocks

This commit is contained in:
Peter Steinberger
2026-01-25 10:22:47 +00:00
parent 98cecc9c56
commit bfa57aae44
4 changed files with 70 additions and 1 deletions

View File

@@ -27,4 +27,14 @@ describe("sanitizeUserFacingText", () => {
const raw = '{"type":"error","error":{"message":"Something exploded","type":"server_error"}}';
expect(sanitizeUserFacingText(raw)).toBe("LLM error server_error: Something exploded");
});
it("collapses consecutive duplicate paragraphs", () => {
const text = "Hello there!\n\nHello there!";
expect(sanitizeUserFacingText(text)).toBe("Hello there!");
});
it("does not collapse distinct paragraphs", () => {
const text = "Hello there!\n\nDifferent line.";
expect(sanitizeUserFacingText(text)).toBe(text);
});
});