Skip to content

fix(discord): preserve streamed assistant preview when a tool failure follows#1

Open
bugkill3r wants to merge 1 commit into
mainfrom
fix/issue-83831-discord-streamed-reply
Open

fix(discord): preserve streamed assistant preview when a tool failure follows#1
bugkill3r wants to merge 1 commit into
mainfrom
fix/issue-83831-discord-streamed-reply

Conversation

@bugkill3r

Copy link
Copy Markdown
Owner

When a turn produces both a streamed assistant text reply and a
tool-failure warning, the warning would arrive as an isError final
payload after the assistant preview was already rendered. The deliver
path then called draftStream.clear() and the cleanup finally also
deleted the preview, leaving only the warning visible.

Detect this case synchronously after flushDraft and claim the
'finalized' state before any further awaits so neither the deliver
path nor the cleanup finally deletes the preserved preview. The
warning is still delivered as a separate follow-up reply.

Closes openclaw#83831

… follows

When a turn produces both a streamed assistant text reply and a
tool-failure warning, the warning would arrive as an isError final
payload after the assistant preview was already rendered. The deliver
path then called draftStream.clear() and the cleanup finally also
deleted the preview, leaving only the warning visible.

Detect this case synchronously after flushDraft and claim the
'finalized' state before any further awaits so neither the deliver
path nor the cleanup finally deletes the preserved preview. The
warning is still delivered as a separate follow-up reply.

Closes openclaw#83831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Discord streamed reply disappears after tool-call failure warning

1 participant