openclaw - 💡(How to fix) Fix [Bug]: Discord early commentary is not committed immediately and can be lost on gateway restart [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#55036Fetched 2026-04-08 01:33:22
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1labeled ×1unsubscribed ×1

On Discord, early assistant commentary is often not committed immediately as a standalone visible message. Instead, it appears to remain inside the in-progress draft / reply-dispatcher pipeline until a later stage, often surfacing only together with the final reply.

This reduces responsiveness.

More importantly, if the gateway restarts before that in-progress content is committed, the commentary may be lost entirely and never appear in Discord.

Root Cause

This issue is not primarily about short preview thresholds. Even long commentary messages can be delayed or lost because the core problem is the reply pipeline’s buffering/commit timing before Discord delivery is finalized.

Fix Action

Fix / Workaround

On Discord, early assistant commentary is often not committed immediately as a standalone visible message. Instead, it appears to remain inside the in-progress draft / reply-dispatcher pipeline until a later stage, often surfacing only together with the final reply.

Early commentary is often delayed and does not appear immediately in Discord. It seems to stay in the in-progress draft / dispatcher pipeline. In many cases it only appears together with the later final answer, making Discord feel less responsive. If the gateway restarts before commit/flush, the commentary may never be delivered at all.

Discord replies go through a draft/dispatcher pipeline: createDiscordDraftStream(...) createReplyDispatcherWithTyping(...) sendFinalReply sendBlockReply sendToolResult dispatcher.waitForIdle()

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Summary

On Discord, early assistant commentary is often not committed immediately as a standalone visible message. Instead, it appears to remain inside the in-progress draft / reply-dispatcher pipeline until a later stage, often surfacing only together with the final reply.

This reduces responsiveness.

More importantly, if the gateway restarts before that in-progress content is committed, the commentary may be lost entirely and never appear in Discord.

Steps to reproduce

A typical pattern is:

assistant emits a substantial early status message such as “Good, I’ll enable Discord streaming, restart the gateway, and verify the result.” then performs the config change / restart-sensitive action then later emits the final outcome

The early status message is long enough that this is not just a “minimum preview length” issue. Even so, the message may remain buffered and fail to appear as an independent Discord message before the restart occurs.

As a result: the user does not see the early acknowledgement immediately and if restart happens first, that commentary can be missing entirely from Discord

Expected behavior

If the assistant produces: an immediate acknowledgement / commentary performs a tool call or long-running action later returns the final result

then the first commentary should be committed to Discord immediately as its own visible message, instead of remaining buffered until the final reply path.

If a restart happens after user-visible commentary has already been generated, that commentary should not be silently lost.

Actual behavior

Early commentary is often delayed and does not appear immediately in Discord. It seems to stay in the in-progress draft / dispatcher pipeline. In many cases it only appears together with the later final answer, making Discord feel less responsive. If the gateway restarts before commit/flush, the commentary may never be delivered at all.

OpenClaw version

2026.3.23

Operating system

Ubuntu 24.04

Install method

No response

Model

openai-codex-gpt-5.4

Provider / routing chain

openclaw -> openai

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

This causes two separate UX problems:

Reduced immediacy Discord feels slower than the assistant actually is.

Message loss restart-sensitive operations can silently drop already-generated user-visible commentary.

Additional information

This issue is not primarily about short preview thresholds. Even long commentary messages can be delayed or lost because the core problem is the reply pipeline’s buffering/commit timing before Discord delivery is finalized.

This is based on local config/state checks plus code inspection.

Discord replies go through a draft/dispatcher pipeline: createDiscordDraftStream(...) createReplyDispatcherWithTyping(...) sendFinalReply sendBlockReply sendToolResult dispatcher.waitForIdle()

Draft preview thresholds exist (minInitialChars, throttleMs), but the issue described here is broader: even sufficiently long early commentary can remain uncommitted the core problem is that early user-visible commentary is not durably committed to Discord immediately

This creates a loss window: commentary already exists logically but Discord still has no committed message restart can happen during that window the user never sees that commentary

extent analysis

Fix Plan

To address the issue of delayed or lost early commentary in Discord, we need to modify the reply pipeline to commit user-visible commentary immediately. Here are the steps:

  • Modify the createDiscordDraftStream function to commit the draft to Discord as soon as user-visible commentary is generated.
  • Add a new function to handle immediate commitment of early commentary, e.g., commitEarlyCommentary.
  • Call commitEarlyCommentary after generating user-visible commentary, before performing long-running actions.

Example code:

def createDiscordDraftStream(...):
    # ... existing code ...
    if commentary_is_user_visible(commentary):
        commitEarlyCommentary(commentary)

def commitEarlyCommentary(commentary):
    # Commit the commentary to Discord immediately
    discord_client.send_message(commentary)
    # Update the draft pipeline to reflect the committed commentary
    update_draft_pipeline(commentary)
  • Update the dispatcher.waitForIdle function to account for the new immediate commitment behavior.

Verification

To verify the fix, test the following scenarios:

  • Generate user-visible commentary and verify it is committed to Discord immediately.
  • Perform a restart after generating user-visible commentary and verify the commentary is not lost.
  • Test with different types of user-visible commentary (e.g., short and long messages).

Extra Tips

  • Review the minInitialChars and throttleMs thresholds to ensure they are not interfering with the new immediate commitment behavior.
  • Consider adding logging or monitoring to track the commitment of user-visible commentary and detect any issues.

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

If the assistant produces: an immediate acknowledgement / commentary performs a tool call or long-running action later returns the final result

then the first commentary should be committed to Discord immediately as its own visible message, instead of remaining buffered until the final reply path.

If a restart happens after user-visible commentary has already been generated, that commentary should not be silently lost.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING