mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
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:
parent
1e857e0a6a
commit
dbee5b69ec
1 changed files with 3 additions and 0 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue