openclaw - 💡(How to fix) Fix [Bug]: Discord partial streaming can leave a truncated draft as the visible final reply

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

With Discord streaming.mode = "partial", a partial live draft can remain visible as the assistant reply even though OpenClaw has stored the complete final reply in the session transcript.

This presents to the user as a truncated Discord message ending in ..., while the full response exists internally.

Error Message

Two Discord replies appeared truncated. Reading the messages back through Discord's API confirmed that the actual Discord message content was incomplete; this was not only a Discord client preview/rendering issue.

Root Cause

This workaround is not yet proven by long-run observation, but it should avoid the exact failure mode because raw assistant answer text is no longer streamed into the Discord draft.

Fix Action

Workaround

Changing Discord streaming mode from partial to progress avoids streaming raw assistant text into the Discord draft:

{
  "mode": "progress"
}

This workaround is not yet proven by long-run observation, but it should avoid the exact failure mode because raw assistant answer text is no longer streamed into the Discord draft.

Code Example

{
  "mode": "partial"
}

---

{
  "mode": "progress"
}
RAW_BUFFERClick to expand / collapse

Summary

With Discord streaming.mode = "partial", a partial live draft can remain visible as the assistant reply even though OpenClaw has stored the complete final reply in the session transcript.

This presents to the user as a truncated Discord message ending in ..., while the full response exists internally.

Environment

  • OpenClaw: 2026.5.12 (f066dd2)
  • Gateway: Linux, systemd user service
  • Channel: Discord DM
  • Streaming config:
{
  "mode": "partial"
}

Observed behavior

Two Discord replies appeared truncated. Reading the messages back through Discord's API confirmed that the actual Discord message content was incomplete; this was not only a Discord client preview/rendering issue.

For the same turns, OpenClaw's session history contained the complete final assistant text.

Observed examples:

  • Discord-visible content: 241 chars
    • OpenClaw stored final assistant reply: 1060 chars
  • Discord-visible content: 399 chars
    • OpenClaw stored final assistant reply: 1318 chars

No evidence was found that the model stopped early. The complete final text existed in OpenClaw after the turn completed.

Expected behavior

The final visible Discord reply should match the complete final assistant reply stored in the OpenClaw session.

If live draft finalization fails or is skipped, the partial draft should be cleared and normal final delivery should still send the complete reply.

Actual behavior

Discord retained a partial live draft as the visible assistant reply.

The full final reply was present in OpenClaw session history, but it was not what the Discord user saw.

Local investigation

The issue appears to involve Discord live draft finalization for streaming.mode = "partial".

In the installed build, the relevant path appears to be:

  • updateFromPartial() updates the Discord draft with partial assistant text when stream mode is partial.
  • Final delivery marks the draft preview as final-delivery-handled before the final edit / fallback normal delivery has completed.
  • Draft cleanup only clears the draft when final delivery has not been marked handled.

That looks like it could leave a partial draft visible if finalization is aborted, skipped, or fails after the handled flag is set.

Relevant symbols from the installed build:

  • updateFromPartial
  • draftStream.update
  • markFinalDeliveryHandled
  • deliverWithFinalizableLivePreviewAdapter
  • draftStream.clear
  • draftStream.discardPending

Workaround

Changing Discord streaming mode from partial to progress avoids streaming raw assistant text into the Discord draft:

{
  "mode": "progress"
}

This workaround is not yet proven by long-run observation, but it should avoid the exact failure mode because raw assistant answer text is no longer streamed into the Discord draft.

Related

Possibly related to #78561, but this is narrower and more severe: the partial draft can become the only visible Discord reply even though the complete final answer exists in OpenClaw session history.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The final visible Discord reply should match the complete final assistant reply stored in the OpenClaw session.

If live draft finalization fails or is skipped, the partial draft should be cleared and normal final delivery should still send the complete reply.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Discord partial streaming can leave a truncated draft as the visible final reply