openclaw - 💡(How to fix) Fix message_sending hooks bypassed when streaming is enabled [1 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#61550Fetched 2026-04-08 02:57:27
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

When Telegram channel has streaming: "partial" configured in openclaw.json, the message_sending plugin hook never fires for the final delivered message.

Root Cause

The hooks only fire when streaming: "off" is set, because then messages go through deliverReplies()getGlobalHookRunner()hasHooks("message_sending")runMessageSending().

Fix Action

Workaround

Set channels.telegram.streaming: "off" in openclaw.json. This forces all messages through the deliverReplies() path where hooks work correctly.

RAW_BUFFERClick to expand / collapse

Description

When Telegram channel has streaming: "partial" configured in openclaw.json, the message_sending plugin hook never fires for the final delivered message.

Steps to Reproduce

  1. Create a plugin that registers a message_sending hook via api.on("message_sending", handler, { priority: 100 })
  2. Configure Telegram channel with streaming: "partial" (or "full") in openclaw.json
  3. Install the plugin and restart the gateway
  4. Send a message to the bot via Telegram
  5. Observe that the message_sending hook handler is never called

Expected Behavior

The message_sending hook should fire for every outgoing message, regardless of whether streaming is enabled or not.

Actual Behavior

With streaming enabled, the final message delivery goes through: createLaneTextDeliverertryUpdatePreviewForLaneeditPreview (Telegram editMessageText)

This path completely bypasses deliverReplies() where message_sending hooks are invoked via applyMessageSendingHook().

The hooks only fire when streaming: "off" is set, because then messages go through deliverReplies()getGlobalHookRunner()hasHooks("message_sending")runMessageSending().

Workaround

Set channels.telegram.streaming: "off" in openclaw.json. This forces all messages through the deliverReplies() path where hooks work correctly.

Environment

  • OpenClaw version: 2026.3.13 (61d171a)
  • Node.js: 22.22.1
  • Channel: Telegram (long polling)

Impact

Any plugin relying on message_sending hooks (e.g., content filtering, URL validation, message transformation) silently fails when streaming is enabled. The plugin loads and registers correctly, but the hook is never invoked.

extent analysis

TL;DR

Disable streaming by setting channels.telegram.streaming: "off" in openclaw.json to ensure the message_sending hook fires for all outgoing messages.

Guidance

  • Verify that the message_sending hook is correctly registered with a sufficient priority (e.g., api.on("message_sending", handler, { priority: 100 })) to ensure it is invoked.
  • Check the OpenClaw configuration file (openclaw.json) to confirm that streaming is set to "partial" or "full", which causes the hook to be bypassed.
  • To mitigate the issue, set channels.telegram.streaming: "off" in openclaw.json to force messages through the deliverReplies() path where hooks are correctly invoked.
  • Test the workaround by sending a message to the bot via Telegram and verifying that the message_sending hook handler is called.

Example

No code snippet is provided as the issue is related to configuration and plugin behavior.

Notes

This workaround may have performance implications, as disabling streaming may increase the load on the server. It is recommended to test the workaround thoroughly to ensure it meets the requirements of your specific use case.

Recommendation

Apply the workaround by setting channels.telegram.streaming: "off" in openclaw.json, as it is a straightforward and effective solution to ensure the message_sending hook fires for all outgoing messages.

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…

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 message_sending hooks bypassed when streaming is enabled [1 participants]