Skip to content

Commit e851625

Browse files
committed
fix(web): retain tool disclosure while hiding live reasoning
1 parent a472a61 commit e851625

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎apps/web/src/components/chat/MessagesTimeline.density.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ describe("applyTimelineDensity", () => {
9292
];
9393
const result = applyTimelineDensity(expanded, { compactWorkLog: true, hideReasoning: false });
9494
expect(result).toEqual(expanded);
95+
const live: MessagesTimelineRow = {
96+
kind: "work-live",
97+
id: "live",
98+
createdAt: "2026-01-01T00:00:00Z",
99+
entry: entry("reasoning", "reasoning"),
100+
groupedEntries: [entry("tool", "command_execution"), entry("reasoning", "reasoning")],
101+
groupId: "work-group:tool",
102+
expanded: true,
103+
active: true,
104+
};
105+
expect(
106+
applyTimelineDensity([live, ...expanded], { compactWorkLog: true, hideReasoning: true })[0],
107+
).toMatchObject({
108+
kind: "thinking",
109+
groupId: "work-group:tool",
110+
expanded: true,
111+
});
95112
});
96113
it("keeps a streaming answer before the synthetic thinking indicator", () => {
97114
const result = applyTimelineDensity(

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,18 @@ export function applyTimelineDensity(
26512651
if (row.kind === "work-live") {
26522652
const groupedEntries = row.groupedEntries.filter((entry) => entry.itemType !== "reasoning");
26532653
if (row.entry.itemType === "reasoning") {
2654-
return row.active ? [{ kind: "thinking", id: row.id, createdAt: row.createdAt }] : [];
2654+
return row.active
2655+
? [
2656+
{
2657+
kind: "thinking",
2658+
id: row.id,
2659+
createdAt: row.createdAt,
2660+
...(groupedEntries.length > 0
2661+
? { groupId: row.groupId, expanded: row.expanded }
2662+
: {}),
2663+
},
2664+
]
2665+
: [];
26552666
}
26562667
if (row.thought === undefined && groupedEntries.length === row.groupedEntries.length)
26572668
return [row];

0 commit comments

Comments
 (0)