fix(discord): register select menu handlers (unique customId)#19882
Open
onevcat wants to merge 1 commit intoopenclaw:mainfrom
Open
fix(discord): register select menu handlers (unique customId)#19882onevcat wants to merge 1 commit intoopenclaw:mainfrom
onevcat wants to merge 1 commit intoopenclaw:mainfrom
Conversation
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.
|
This pull request has been automatically marked as stale due to inactivity. |
Contributor
Author
|
When mixed used, the Discord controls are not working properly even in the current version. So I believe this still worths a look/fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Discord select menus (component type 3) sent via OpenClaw components can fail with “This interaction failed”. Gateway logs show:
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 withcustomId="*", so only the first handler is registered; the select handlers never get registered.Fix
Assign unique
customIdvalues to each handler while keeping theoccomp:/ocmodal:prefix soparseDiscordComponentCustomIdForCarbon/parseDiscordModalCustomIdForCarbonstill normalize tokey="*"for wildcard matching.Tests
Add a unit test to ensure:
"*"customIdkey="*"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
ComponentHandlerde-duplicates handlers bycustomId. All six component handlers (button plus five select types) and the modal handler previously shared the same wildcardcustomId, so only the first-registered handler (button) was active. Select menu interactions were silently dropped.The fix assigns unique
customIdvalues to each handler while preserving theoccomp/ocmodalprefix so the Carbon custom-ID parsers still normalize to wildcard matching at runtime.AgentComponentButtonandAgentSelectMenualready use unique custom IDsConfidence Score: 5/5
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!