openclaw - 💡(How to fix) Fix Discord components v2 buttons: INTERACTION_CREATE not matched by wildcard handler [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#59885Fetched 2026-04-08 02:39:18
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Discord component v2 buttons sent via openclaw message send --components render correctly and register "components": true in the response, but clicking them results in Discord showing "This interaction failed" — meaning no ACK is sent within 3 seconds.

Root Cause

Discord component v2 buttons sent via openclaw message send --components render correctly and register "components": true in the response, but clicking them results in Discord showing "This interaction failed" — meaning no ACK is sent within 3 seconds.

Code Example

openclaw message send \
  --channel discord \
  --account bz-auto \
  --target channel:<channelId> \
  --components '{"reusable":true,"text":"Test","blocks":[{"type":"actions","buttons":[{"label":"Approve","style":"success"},{"label":"Reject","style":"danger"}]}]}' \
  --json
RAW_BUFFERClick to expand / collapse

Bug Report

Summary

Discord component v2 buttons sent via openclaw message send --components render correctly and register "components": true in the response, but clicking them results in Discord showing "This interaction failed" — meaning no ACK is sent within 3 seconds.

Environment

  • OpenClaw version: 2026.4.1 (da64a97)
  • Node: v22.22.1
  • macOS (Apple Silicon)
  • Discord.js/Carbon gateway (WebSocket mode, no HTTP interactions endpoint)

Steps to Reproduce

openclaw message send \
  --channel discord \
  --account bz-auto \
  --target channel:<channelId> \
  --components '{"reusable":true,"text":"Test","blocks":[{"type":"actions","buttons":[{"label":"Approve","style":"success"},{"label":"Reject","style":"danger"}]}]}' \
  --json

Response includes "components": true, buttons render in Discord, but clicking any button shows "This interaction failed".

Expected Behavior

Clicking the button should be ACKed and routed back to the agent as an inbound event (per docs: "Interaction results are routed back to the agent as normal inbound messages").

Actual Behavior

  • Discord shows "This interaction failed" (no ACK within 3s)
  • Gateway logs show zero INTERACTION_CREATE events for the button click
  • No errors in gateway log related to the interaction

What Works (for comparison)

Exec approval buttons (e.g., Allow once / Always allow / Deny) work correctly on the same bot:

  • Fresh clicks → approval processed
  • Expired clicks → bot replies with "This component is no longer valid" (proves interaction IS received and handler runs)

These use ExecApprovalActionButton with customId = "exec-approval:id=...;action=...".

Investigation Findings

  1. autoInteractions: true is hardcoded in createDiscordGatewayPluginInteractionEventListener is registered
  2. agentComponents.enabled: true on the account — createDiscordComponentButton (wildcard handler) is registered
  3. Wildcard handler DiscordComponentButton uses customId = "__openclaw_discord_component_button_wildcard__" with customIdParser = parseDiscordComponentCustomIdForCarbon
  4. Component builder in components-B8kdCgo5.js generates buttons with customId = "occomp:cid=btn_xxx"
  5. Parser parseDiscordComponentCustomIdForCarbon correctly maps occomp:*{ key: "*", data: ... }

The custom_id format and parser look correct, but the interaction never reaches the handler. Possible causes:

  • Carbon's component matching may not invoke customIdParser for incoming interactions that don't literally match the registered customId string
  • The wildcard registration pattern __openclaw_discord_component_button_wildcard__ may need special handling in Carbon's handleInteraction to trigger the parser

Relevant Code Paths

  • provider-CB-sso-D.js:13247DiscordComponentButton class
  • provider-CB-sso-D.js:13529createDiscordComponentButton
  • components-B8kdCgo5.js:6DISCORD_COMPONENT_CUSTOM_ID_KEY = "occomp"
  • components-B8kdCgo5.jsparseDiscordComponentCustomIdForCarbon
  • provider-CB-sso-D.js:11208autoInteractions registration

Additional Context

  • Tested with both agent account (bz-auto) and default account — same behavior
  • Bot has all Gateway Intents enabled (including MESSAGE_CONTENT)
  • Interactions Endpoint URL is empty (WebSocket mode)
  • Discord channel status shows connected, works, audit ok
  • --interactive flag sends buttons that render without the component framework (no handlers at all)
  • --components with the documented JSON format (blocks/actions/buttons) is the only supported path

extent analysis

TL;DR

The issue can be resolved by adjusting the custom ID parsing and handling for Discord component buttons to ensure compatibility with Carbon's interaction handling.

Guidance

  • Verify that the customIdParser is correctly mapping the occomp:* format to the expected data structure, and that this parser is being invoked for incoming interactions.
  • Investigate Carbon's component matching and interaction handling to determine if special handling is required for the wildcard registration pattern __openclaw_discord_component_button_wildcard__.
  • Check the createDiscordComponentButton function to ensure it is correctly registering the wildcard handler with the customIdParser.
  • Test the interaction handling with a custom ID that exactly matches the registered customId string to isolate the issue.

Example

No code snippet is provided due to the complexity of the issue and the need for further investigation.

Notes

The issue may be related to the custom ID format and parsing, as well as the interaction handling in Carbon. Further investigation is required to determine the root cause and implement a fix.

Recommendation

Apply a workaround by adjusting the custom ID parsing and handling to ensure compatibility with Carbon's interaction handling, as this is the most likely cause of the issue.

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