From 1d90592df1a00be111ad864789814bf6d96c01a9 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 29 Dec 2025 14:26:18 +0100 Subject: [PATCH] fix(coding-agent): always show error/aborted assistant messages in tree --- .../modes/interactive/components/tree-selector.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts index 6a109c9b..c5d58316 100644 --- a/packages/coding-agent/src/modes/interactive/components/tree-selector.ts +++ b/packages/coding-agent/src/modes/interactive/components/tree-selector.ts @@ -138,17 +138,14 @@ class TreeList implements Component { const entry = flatNode.node.entry; const isCurrentLeaf = entry.id === this.currentLeafId; - // Skip assistant messages with failed stopReason or no text content - // BUT always show the current leaf so active position is visible + // Skip assistant messages with only tool calls (no text) unless error/aborted + // Always show current leaf so active position is visible if (entry.type === "message" && entry.message.role === "assistant" && !isCurrentLeaf) { const msg = entry.message as { stopReason?: string; content?: unknown }; - // Skip aborted/error messages - if (msg.stopReason && msg.stopReason !== "stop" && msg.stopReason !== "toolUse") { - return false; - } - // Skip messages with only tool calls (no text content) const hasText = this.hasTextContent(msg.content); - if (!hasText) { + const isErrorOrAborted = msg.stopReason && msg.stopReason !== "stop" && msg.stopReason !== "toolUse"; + // Only hide if no text AND not an error/aborted message + if (!hasText && !isErrorOrAborted) { return false; } }