From ef740acbae8463a8c9c56699da1d53ce58752b5f Mon Sep 17 00:00:00 2001 From: Dotta Date: Fri, 24 Apr 2026 13:02:54 -0500 Subject: [PATCH] Stabilize running task chain of thought Keep live run chain-of-thought sections in the active Working state until the run itself completes, even during gaps between command executions. Add a regression test for a running run whose latest command already has a result. Co-Authored-By: Paperclip --- ui/src/components/IssueChatThread.test.tsx | 60 ++++++++++++++++++++++ ui/src/components/IssueChatThread.tsx | 3 +- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx index 653379802ce..1f94f0344be 100644 --- a/ui/src/components/IssueChatThread.test.tsx +++ b/ui/src/components/IssueChatThread.test.tsx @@ -1460,6 +1460,66 @@ describe("IssueChatThread", () => { }); }); + it("keeps a running chain-of-thought in the Working state between commands", () => { + const root = createRoot(container); + + act(() => { + root.render( + + {}} + enableLiveTranscriptPolling={false} + /> + , + ); + }); + + expect(container.textContent).toContain("Working"); + expect(container.textContent).not.toContain("Worked"); + + act(() => { + root.unmount(); + }); + }); + it("folds chain-of-thought when the same message transitions from running to complete", () => { expect(resolveAssistantMessageFoldedState({ messageId: "message-1", diff --git a/ui/src/components/IssueChatThread.tsx b/ui/src/components/IssueChatThread.tsx index e10b8cc33bc..f4bdaa8ab1a 100644 --- a/ui/src/components/IssueChatThread.tsx +++ b/ui/src/components/IssueChatThread.tsx @@ -768,8 +768,7 @@ function IssueChatChainOfThought({ (p): p is ToolCallMessagePart => p.type === "tool-call", ); - const hasActiveTool = toolParts.some((t) => t.result === undefined); - const isActive = isMessageRunning && hasActiveTool; + const isActive = isMessageRunning; const [expanded, setExpanded] = useState(isActive); const rawSegments = Array.isArray(custom.chainOfThoughtSegments)