Skip to content

Commit 59324bb

Browse files
fix(web): a chat created after a steer stays where it happened
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent d08197e commit 59324bb

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4622,6 +4622,22 @@ describe("assistant meta in steered runs", () => {
46224622
"assistant-meta:final",
46234623
]);
46244624
});
4625+
4626+
it("leaves a created thread in place when no response follows the steer that made it", () => {
4627+
const timelineEntries = [
4628+
message("prompt", 0, "user", "turn_start"),
4629+
message("cut-off", 2, "assistant"),
4630+
message("steer", 5, "user", "steer"),
4631+
{ ...createdThread, createdAt: time(8) },
4632+
];
4633+
4634+
expect(settledRows(timelineEntries, true).map((row) => row.id)).toEqual([
4635+
"prompt",
4636+
"cut-off",
4637+
"steer",
4638+
"created",
4639+
]);
4640+
});
46254641
});
46264642

46274643
describe("linked timeline resources", () => {

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,14 @@ function attachCreatedThreadSummaries(
20542054
const collapsedRuns = new Set<RunId>();
20552055
const createdByRun = new Map<RunId, Array<Extract<MessagesTimelineRow, { kind: "event" }>>>();
20562056
for (const [index, row] of rows.entries()) {
2057-
if (row.kind === "message" && row.showAssistantMeta && row.message.runId) {
2057+
// A response a steer cut off is not the run's answer, even when no reply
2058+
// follows the steer yet; created chats then stay where they happened.
2059+
if (
2060+
row.kind === "message" &&
2061+
row.showAssistantMeta &&
2062+
row.assistantMidRun !== true &&
2063+
row.message.runId
2064+
) {
20582065
terminalIndexes.set(row.message.runId, index);
20592066
}
20602067
if (row.kind === "turn-fold" && !row.expanded) collapsedRuns.add(row.runId);

0 commit comments

Comments
 (0)