[Fix] Accept Discord button clicks and keep their task threads anchored#441
Merged
Conversation
Contributor
Two defects found dogfooding the routing-confirmation flow against real Discord: - Every component interaction was rejected as invalid and quarantined. The envelope schema typed data.id as a string, but Discord sends the pressed component's numeric layout id there; only slash commands send a snowflake string, which is why /link worked while every button did nothing at all. Accept both shapes. - A launch confirmed through the routing card detached its task thread. The launch happens on the button interaction, which has no message of its own, so the anchor from the original mention has to ride along in the pending route; the API now stamps it from the triggering message and it survives the round trip. Interactions still have no anchor of their own, so /new and suggestion buttons keep their detached threads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
daniel-lxs
force-pushed
the
fix/discord-button-interactions
branch
from
July 16, 2026 19:01
ab15513 to
53c1ac8
Compare
Member
Author
|
Verified live against real Discord after rebasing onto #438. Before the fix (task run 51) vs after (task run 52), comparing the launch payload's source message id against the created thread id:
The thread id now equals the triggering message id, and Discord renders the task thread nested under the requester's message rather than as a detached "Roomotedev started a thread" line. Full path exercised: mention → routing card → button click (previously a silent no-op, now accepted) → task launch → anchored thread → early-title rename. 🤖 Generated with Claude Code |
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.
Two defects found while dogfooding the routing-confirmation flow against a real Discord bot.
Every button click was silently discarded
The envelope schema typed
data.idas a string, but Discord sends the pressed component's numeric layout id there — only slash commands send a snowflake string, which is exactly why/linkworked whileAll repositoriesdid nothing at all. Every component interaction failed validation withinvalid_discord_event(400) and was quarantined to the dead-letter stream. Now both shapes are accepted.Confirmed launches detached their task thread
When routing needs a confirmation card, the launch happens on the button interaction, which has no message of its own — so the anchor from the original mention was lost and the task thread fell back to detached (visible as "Roomotedev started a thread" instead of a thread on the requester's message). The API now stamps the anchor from the triggering message; it rides along in the pending route and survives the round trip to the confirmed launch.
Interactions genuinely have no anchor of their own, so
/newand suggestion-card buttons keep their detached threads by design.Validation
data.idenvelope parses; anchor survives the pending-route round trip)Found by the same dogfooding session as #432 and #438 — three real Discord-contract bugs the mock harness structurally could not catch, because it encoded our assumptions about Discord rather than Discord's actual behavior.
🤖 Generated with Claude Code