Skip to content

Commit 6a6d7b8

Browse files
committed
fix(chat): do not clear statusCache on fallback -- it is a mid-execution retry not a terminal state
1 parent 0215b0f commit 6a6d7b8

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

‎webview-ui/src/components/chat/CommandExecution.tsx‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,19 @@ export const CommandExecution = ({ executionId, text, icon, title }: CommandExec
145145
case "exited":
146146
case "error":
147147
case "timeout":
148-
case "fallback":
149-
// All terminal/non-recoverable states clear the cache so a
150-
// fresh component mounting after any of these events does not
151-
// inherit a stale "started" entry and incorrectly show the
152-
// pulse dot.
148+
// Terminal states clear the cache so a fresh component
149+
// mounting after execution ends does not inherit a stale
150+
// "started" entry and incorrectly show the pulse dot.
151+
// Map.delete on a missing key is a no-op, so duplicate
152+
// deletes (e.g. error followed by exited) are safe.
153153
statusCache.delete(executionId)
154154
setStatus(data)
155-
if (data.status === "fallback") {
156-
setIsExpanded(true)
157-
}
155+
break
156+
case "fallback":
157+
// Not a terminal state -- signals a mid-execution retry
158+
// via execa after a shell integration failure. A new
159+
// "started" event will follow, so leave the cache intact.
160+
setIsExpanded(true)
158161
break
159162
case "output":
160163
setStreamingOutput(data.output)

0 commit comments

Comments
 (0)