openclaw - 💡(How to fix) Fix [Bug]: Discord reply metadata is not exposed to before_dispatch hooks

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…

In OpenClaw 2026.5.28, Discord reply metadata is finalized into ReplyToId, ReplyToBody, and ReplyToSender, but those fields are not exposed to before_dispatch plugin hooks.

Root Cause

This is expected because OpenClaw 2026.5.28 already derives Discord quote metadata and finalizes it into inbound context fields:

Fix Action

Fix / Workaround

In OpenClaw 2026.5.28, Discord reply metadata is finalized into ReplyToId, ReplyToBody, and ReplyToSender, but those fields are not exposed to before_dispatch plugin hooks.

  1. Install or write a plugin that registers a before_dispatch hook and logs the hook event and ctx.
  2. Configure Discord as a channel.
  3. Send a Discord message that replies to an earlier Discord message.
  4. Inspect the before_dispatch hook payload for the inbound replied message.

The before_dispatch hook should expose the Discord reply target metadata, either as replyToId / replyToBody / replyToSender on the hook event/context or through an equivalent documented field.

Code Example

Published package inspection for OpenClaw 2026.5.28:

dist/inbound-context-CbkangX1.js:
  ReplyToId: supplemental.quote?.id
  ReplyToBody: supplemental.quote?.body
  ReplyToSender: supplemental.quote?.sender

dist/message-hook-mappers-DBnpM4vz.js:
  deriveInboundMessageHookContext(...) does not map ReplyToId, ReplyToBody, or ReplyToSender.

dist/dispatch-DphqeP-y.js:
  hookRunner.runBeforeDispatch(...) event/context omit replyToId, replyToBody, and replyToSender.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

In OpenClaw 2026.5.28, Discord reply metadata is finalized into ReplyToId, ReplyToBody, and ReplyToSender, but those fields are not exposed to before_dispatch plugin hooks.

Steps to reproduce

  1. Install or write a plugin that registers a before_dispatch hook and logs the hook event and ctx.
  2. Configure Discord as a channel.
  3. Send a Discord message that replies to an earlier Discord message.
  4. Inspect the before_dispatch hook payload for the inbound replied message.

Expected behavior

The before_dispatch hook should expose the Discord reply target metadata, either as replyToId / replyToBody / replyToSender on the hook event/context or through an equivalent documented field.

This is expected because OpenClaw 2026.5.28 already derives Discord quote metadata and finalizes it into inbound context fields:

  • ReplyToId
  • ReplyToBody
  • ReplyToSender

Actual behavior

The finalized inbound context contains the reply metadata, but the before_dispatch hook boundary drops it.

Observed in the published 2026.5.28 package:

  • dist/inbound-context-CbkangX1.js maps SupplementalContext.quote into ReplyToId, ReplyToBody, and ReplyToSender.
  • dist/message-hook-mappers-DBnpM4vz.js deriveInboundMessageHookContext(...) does not include those fields.
  • dist/dispatch-DphqeP-y.js calls hookRunner.runBeforeDispatch(...) without including those fields in either the event or context object.

As a result, plugins cannot reliably implement reply-aware Discord commands through the public before_dispatch hook API.

OpenClaw version

2026.5.28

Operating system

Ubuntu 24.04

Install method

npm global

Model

Not model-dependent; the issue occurs before model dispatch.

Provider / routing chain

Not provider-dependent; reproduced at the Discord channel/plugin hook boundary before model routing matters.

Additional provider/model setup details

NOT_ENOUGH_INFO

Logs, screenshots, and evidence

Published package inspection for OpenClaw 2026.5.28:

dist/inbound-context-CbkangX1.js:
  ReplyToId: supplemental.quote?.id
  ReplyToBody: supplemental.quote?.body
  ReplyToSender: supplemental.quote?.sender

dist/message-hook-mappers-DBnpM4vz.js:
  deriveInboundMessageHookContext(...) does not map ReplyToId, ReplyToBody, or ReplyToSender.

dist/dispatch-DphqeP-y.js:
  hookRunner.runBeforeDispatch(...) event/context omit replyToId, replyToBody, and replyToSender.

Impact and severity

Affected: plugin authors using before_dispatch to implement Discord reply-aware commands.

Severity: Medium. This blocks reply-aware command handling for plugins unless they use an undocumented workaround or patch OpenClaw/plugin internals.

Frequency: Always observed for this hook path in 2026.5.28 when relying on before_dispatch.

Consequence: Plugins cannot determine which Discord message was replied to, even though the channel/runtime has already resolved that metadata internally.

Additional information

A local workaround is to pass the Discord reply target through a channel-specific command marker before before_dispatch, but that requires patching the Discord plugin and should not be necessary if the hook API exposes the already-finalized reply metadata.

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 before_dispatch hook should expose the Discord reply target metadata, either as replyToId / replyToBody / replyToSender on the hook event/context or through an equivalent documented field.

This is expected because OpenClaw 2026.5.28 already derives Discord quote metadata and finalizes it into inbound context fields:

  • ReplyToId
  • ReplyToBody
  • ReplyToSender

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 reply metadata is not exposed to before_dispatch hooks