openclaw - 💡(How to fix) Fix feat(plugins): enable plugins to respond to Discord reaction events [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#60805Fetched 2026-04-08 02:46:57
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Plugins using the before_agent_start hook cannot effectively respond to Discord reaction events because:

  1. Reaction system events don't trigger a new agent turn — they are queued via enqueueSystemEvent() and only injected into context when the user sends a follow-up message. This means a plugin cannot respond to a reaction in real time.
  2. No dedicated plugin hook for reactions — the only way to see reactions is by scanning messages in before_agent_start, which requires a separate user message to trigger.

This blocks plugins like emoji-confirm-mvp that map emoji reactions to yes/no confirmations.

Root Cause

Plugins using the before_agent_start hook cannot effectively respond to Discord reaction events because:

Fix Action

Fix / Workaround

Option A: Reaction system events trigger an agent turn

When a reaction is queued as a system event, automatically dispatch an agent turn on that session. This would allow existing before_agent_start hooks to see the reaction text in the messages and respond. This is the simpler approach and would work with existing plugins.

RAW_BUFFERClick to expand / collapse

Summary

Plugins using the before_agent_start hook cannot effectively respond to Discord reaction events because:

  1. Reaction system events don't trigger a new agent turn — they are queued via enqueueSystemEvent() and only injected into context when the user sends a follow-up message. This means a plugin cannot respond to a reaction in real time.
  2. No dedicated plugin hook for reactions — the only way to see reactions is by scanning messages in before_agent_start, which requires a separate user message to trigger.

This blocks plugins like emoji-confirm-mvp that map emoji reactions to yes/no confirmations.

Context

We confirmed in #60758 that the full reaction pipeline works: Discord sends MESSAGE_REACTION_ADD → OpenClaw receives it → DiscordReactionListener handles it → enqueueSystemEvent() queues it. But nothing triggers an agent turn from that event, so plugins never see it until the user sends another message.

Suggested approaches (not mutually exclusive)

Option A: Reaction system events trigger an agent turn

When a reaction is queued as a system event, automatically dispatch an agent turn on that session. This would allow existing before_agent_start hooks to see the reaction text in the messages and respond. This is the simpler approach and would work with existing plugins.

Option B: New on_reaction plugin hook

Add a new plugin hook (e.g., on_reaction) that fires directly when a reaction event is received, before it's queued as a system event. This would give plugins direct access to the reaction data (emoji, user ID, message ID, channel) and allow them to return a response or inject context without waiting for an agent turn.

Environment

  • OpenClaw 2026.4.2 (d74a122)
  • Tested with Discord channel, both DM and guild
  • Related: #60758

extent analysis

TL;DR

Implementing a new on_reaction plugin hook or modifying the reaction system to trigger an agent turn when a reaction event is queued could resolve the issue.

Guidance

  • Consider implementing Option B: New on_reaction plugin hook to give plugins direct access to reaction data and allow them to respond without waiting for an agent turn.
  • Evaluate the feasibility of Option A: Reaction system events trigger an agent turn, which would enable existing before_agent_start hooks to see reaction text in messages and respond.
  • Assess the compatibility of either approach with existing plugins, such as emoji-confirm-mvp, to ensure a seamless integration.
  • Investigate the potential impact on the overall system performance and user experience when introducing a new hook or modifying the reaction system.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The choice between Option A and Option B depends on the desired plugin functionality and the system's architecture. It is essential to consider the trade-offs and potential consequences of each approach before making a decision.

Recommendation

Apply workaround by implementing Option B: New on_reaction plugin hook, as it provides a more direct and flexible solution for plugins to handle reaction events, allowing for a more responsive and interactive user experience.

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 feat(plugins): enable plugins to respond to Discord reaction events [1 participants]