← Back to PRs

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

by onevcat open 2026-02-18 08:10 View on GitHub →
channel: discord size: S
## 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_comment --> <h3>Greptile Summary</h3> 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 <h3>Confidence Score: 5/5</h3> - 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. <sub>Last reviewed commit: 9a7c320</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs