fix(coding-agent): Coalesce adjacent assistant thinking blocks into one section

This commit is contained in:
Mario Zechner
2026-07-15 12:52:53 +02:00
parent fab309e955
commit 45203abfa0
3 changed files with 44 additions and 11 deletions
@@ -74,6 +74,24 @@ describe("AssistantMessageComponent", () => {
expect(rendered).toContain("response may be incomplete");
});
test("coalesces adjacent thinking blocks into one hidden thinking label", () => {
initTheme("dark");
const component = new AssistantMessageComponent(
createAssistantMessage([
{ type: "thinking", thinking: "first thought" },
{ type: "thinking", thinking: "" },
{ type: "thinking", thinking: "second thought" },
{ type: "text", text: "answer" },
]),
true,
);
const rendered = stripAnsi(component.render(80).join("\n"));
expect(rendered.match(/Thinking\.\.\./g)).toHaveLength(1);
expect(rendered).toContain("answer");
});
test("uses configured output padding for text and thinking", () => {
initTheme("dark");