refactor: streamline TUI stream assembly updates

This commit is contained in:
Peter Steinberger
2026-01-20 08:45:07 +00:00
parent c17c7b4e24
commit 32a668e4d9
3 changed files with 48 additions and 20 deletions

View File

@@ -65,4 +65,29 @@ describe("TuiStreamAssembler", () => {
expect(finalText).toBe("Streamed");
});
it("returns null when delta text is unchanged", () => {
const assembler = new TuiStreamAssembler();
const first = assembler.ingestDelta(
"run-4",
{
role: "assistant",
content: [{ type: "text", text: "Repeat" }],
},
false,
);
expect(first).toBe("Repeat");
const second = assembler.ingestDelta(
"run-4",
{
role: "assistant",
content: [{ type: "text", text: "Repeat" }],
},
false,
);
expect(second).toBeNull();
});
});