#19882: fix(discord): register select menu handlers (unique customId)
channel: discord
size: S
Cluster:
Discord and MS Teams Fixes
## 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
#20009: fix(discord): immediately defer interactions to prevent timeouts
by Gitjay11 · 2026-02-18
76.0%
#17648: fix: Discord guild channel detection using rawMessage.guild_id
by MisterGuy420 · 2026-02-16
75.2%
#22557: fix(discord): coerce exec approval approver IDs to string to preven...
by zwffff · 2026-02-21
71.8%
#22611: fix(discord): allow messages from other instance bots in multi-acco...
by dae-sun · 2026-02-21
71.4%
#21463: fix(discord): prevent WebSocket death spiral + fix numeric channel ID…
by akropp · 2026-02-20
71.0%
#19615: fix(discord): include default account when sub-accounts are configured
by prue-starfield · 2026-02-18
69.6%
#16801: fix: Register Discord listeners before gateway connects
by MisterGuy420 · 2026-02-15
69.4%
#17254: fix(discord): intercept text-based slash commands instead of forwar...
by robbyczgw-cla · 2026-02-15
69.3%
#20913: fix: intercept Discord embed images to enforce mediaMaxMb
by MumuTW · 2026-02-19
69.0%
#16685: Fix cli agents/approvals/discord routing edge cases
by craftowen · 2026-02-15
68.9%