Skip to content

fix(discord): register select menu handlers (unique customId)#19882

Open
onevcat wants to merge 1 commit intoopenclaw:mainfrom
onevcat:fix/discord-select-menu
Open

fix(discord): register select menu handlers (unique customId)#19882
onevcat wants to merge 1 commit intoopenclaw:mainfrom
onevcat:fix/discord-select-menu

Conversation

@onevcat
Copy link
Contributor

@onevcat onevcat commented Feb 18, 2026

Problem

Discord select menus (component type 3) sent via OpenClaw components can fail with “This interaction failed”. Gateway logs show:

Unknown component with type 3 and custom ID occomp:cid=sel_... was received, did you forget to register the component?

Buttons and modals continue to work.

Root cause

Carbon de-dupes component registrations by customId. OpenClaw registered multiple Discord component handlers (button / string select / user select / role select / mentionable select / channel select) all with customId="*", so only the first handler is registered; the select handlers never get registered.

Fix

Assign unique customId values to each handler while keeping the occomp: / ocmodal: prefix so parseDiscordComponentCustomIdForCarbon / parseDiscordModalCustomIdForCarbon still normalize to key="*" for wildcard matching.

Tests

Add a unit test to ensure:

  • each handler uses a unique, non-"*" customId
  • the Carbon parser still yields key="*"

This prevents regressions where handlers accidentally share the same customId again.

Greptile Summary

Fixes Discord select menu interactions failing with "This interaction failed" because Carbon's ComponentHandler de-duplicates handlers by customId. All six component handlers (button plus five select types) and the modal handler previously shared the same wildcard customId, so only the first-registered handler (button) was active. Select menu interactions were silently dropped.

The fix assigns unique customId values to each handler while preserving the occomp/ocmodal prefix so the Carbon custom-ID parsers still normalize to wildcard matching at runtime.

  • Consistent with how AgentComponentButton and AgentSelectMenu already use unique custom IDs
  • New regression test verifies uniqueness and parser round-trip for all handlers
  • No behavioral changes to how interactions are dispatched; only the registration identity changes

Confidence Score: 5/5

  • This PR is safe to merge — it is a targeted, well-tested fix for a clear registration bug with no risk of side effects.
  • The change is minimal and precise: it replaces hardcoded wildcard customId values with unique prefixed strings that still pass through the existing parser correctly. The fix is consistent with the pattern already used by AgentComponentButton and AgentSelectMenu. A regression test validates both the uniqueness constraint and the parser round-trip. No logic paths are altered beyond the registration identity.
  • No files require special attention.

Last reviewed commit: 9a7c320

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

Carbon de-dupes components by customId; multiple OpenClaw handlers used '*' so only one registered, breaking select menus.

Use unique occomp:/ocmodal: customIds per handler and add a unit test to prevent regressions.
@openclaw-barnacle openclaw-barnacle bot added channel: discord Channel integration: discord size: S labels Feb 18, 2026
@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 28, 2026
@onevcat
Copy link
Contributor Author

onevcat commented Feb 28, 2026

When mixed used, the Discord controls are not working properly even in the current version. So I believe this still worths a look/fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant