Skip to content

Commit 60218ae

Browse files
committed
test(web): lock live turn activity copy
1 parent 1f7adbb commit 60218ae

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎apps/web/src/components/chat/MessagesTimeline.test.tsx‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,45 @@ describe("MessagesTimeline", () => {
858858
expect(markup).not.toContain("tool call failed");
859859
});
860860

861+
it("keeps terminal command copy live while the parent turn is active", () => {
862+
const turnId = TurnId.make("turn-live");
863+
const markup = renderToStaticMarkup(
864+
<MessagesTimeline
865+
{...buildProps()}
866+
isWorking
867+
activeTurnStartedAt={MESSAGE_CREATED_AT}
868+
latestTurn={{
869+
turnId,
870+
state: "running",
871+
startedAt: MESSAGE_CREATED_AT,
872+
completedAt: null,
873+
}}
874+
runningTurnId={turnId}
875+
timelineEntries={[
876+
{
877+
id: "entry-failed",
878+
kind: "work",
879+
createdAt: MESSAGE_CREATED_AT,
880+
entry: {
881+
id: "work-failed",
882+
createdAt: MESSAGE_CREATED_AT,
883+
turnId,
884+
toolCallId: "call-failed",
885+
label: "Run lint",
886+
tone: "tool",
887+
itemType: "command_execution",
888+
command: "pnpm lint",
889+
toolLifecycleStatus: "failed",
890+
},
891+
},
892+
]}
893+
/>,
894+
);
895+
896+
expect(markup).toContain("Running pnpm");
897+
expect(markup).toContain("tool call failed");
898+
});
899+
861900
it("aligns the iconless Thinking row with the working timer", () => {
862901
const markup = renderToStaticMarkup(
863902
<MessagesTimeline

‎apps/web/src/components/chat/MessagesTimeline.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,6 +2403,8 @@ function liveWorkEntryLabel(
24032403
): string {
24042404
const command = workEntry.command?.trim();
24052405
if (command) {
2406+
// This row describes the active parent turn, not the command lifecycle.
2407+
// Keep its live "Running" copy until the turn or contiguous tool run settles.
24062408
const program = commandProgramName(command);
24072409
if (program) return `Running ${program}`;
24082410
return "Running command";

0 commit comments

Comments
 (0)