Show "Aborted" text when aborting text generation during streaming

Update streaming component with final message in message_end event.
The final message includes the stopReason, which allows the component
to render "Aborted" text for aborted text generation.

Now behavior is consistent:
- Abort during text generation (no tool calls) → shows red "Aborted"
- Abort during tool call streaming → tool components turn red
This commit is contained in:
Mario Zechner 2025-11-11 23:41:05 +01:00
parent 1e857e0a6a
commit dbee5b69ec

View file

@ -215,6 +215,9 @@ export class TuiRenderer {
if (this.streamingComponent && event.message.role === "assistant") {
const assistantMsg = event.message as AssistantMessage;
// Update streaming component with final message (includes stopReason)
this.streamingComponent.updateContent(assistantMsg);
// If message was aborted or errored, mark all pending tool components as failed
if (assistantMsg.stopReason === "aborted" || assistantMsg.stopReason === "error") {
const errorMessage =