Skip to content

Commit 971d645

Browse files
bloveclaude
andauthored
fix(chat): hide message actions on content-less messages (compact subagent cards) (#721)
A subagent delegation renders as its own assistant message whose only content is the subagent card (no assistant text). It was still getting the full message- actions toolbar (regenerate/copy/thumbs up/down) — pure whitespace, since there is nothing to copy/regenerate/rate — which bloated the stream. Gate <chat-message-actions> on the message having copyable text (`content.trim()`). Subagent cards and bare tool-call messages now render compact; real answers keep their actions. Verified live in examples/ag-ui (research subagent): the delegation card's actions toolbar is gone; the answer message retains exactly one actions toolbar. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 6580abb commit 971d645

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

libs/chat/src/lib/compositions/chat/chat.component.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,21 @@ export function isPinned(
248248
/>
249249
}
250250
}
251-
<chat-message-actions
252-
chatMessageControls
253-
[content]="content"
254-
[disabled]="agent().isLoading()"
255-
(regenerate)="onRegenerate(i)"
256-
(rate)="onRate(message, $event)"
257-
(contentCopied)="onCopy(message, $event)"
258-
/>
251+
<!-- Only show message actions when there is copyable assistant
252+
text. Content-less messages (a bare tool call or a subagent
253+
delegation card) have nothing to copy/regenerate/rate, so the
254+
actions panel is pure whitespace there — suppress it to keep
255+
the stream compact. -->
256+
@if (content.trim()) {
257+
<chat-message-actions
258+
chatMessageControls
259+
[content]="content"
260+
[disabled]="agent().isLoading()"
261+
(regenerate)="onRegenerate(i)"
262+
(rate)="onRate(message, $event)"
263+
(contentCopied)="onCopy(message, $event)"
264+
/>
265+
}
259266
</chat-message>
260267
</ng-template>
261268

0 commit comments

Comments
 (0)