Skip to content

message_sending hooks bypassed when streaming is enabled #61550

Description

@Postmanplayx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions