Repository navigation
refactor(discord): consolidate interactive response handling - #119448
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 11:20 PM ET / August 5, 2026, 03:20 UTC. ClawSweeper reviewWhat this changesThis PR consolidates Discord component failure replies and shares select/button rendering logic while preserving existing interactive behavior. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 3 items remain Keep open for human review: the refactor appears behavior-preserving and correctly owned by the Discord plugin, but the PR has a protected maintainer label and only test/CI evidence rather than after-fix real interaction proof. Priority: P3 Review scores
Verification
How this fits togetherDiscord renders portable presentation actions into persisted buttons, selects, and modals, then routes user interactions through authorization and per-user allowlist checks before dispatching events or private replies. flowchart LR
A[Presentation actions] --> B[Discord component renderer]
B --> C[Persisted components]
C --> D[Authorization and allowlist checks]
D --> E[Private reply or event dispatch]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -92. Total -92 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the Discord-local consolidation and add a redacted real bot or mock-gateway interaction transcript covering a successful component action and an unavailable/expired reply. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing Discord behavior rather than reporting a discrete user-facing failure. Is this the best way to solve the issue? Yes: the shared Discord helper and select builder remove duplicate local policy while preserving the existing SDK action contract and handler boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a8caab5c3d3c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Discord interactive replies duplicated private invalid/expired-component failure handling across buttons, selects, modal triggers, modal submissions, and system controls. The legacy interactive and current presentation renderers also maintained duplicate select construction and action-value logic, increasing maintenance risk for interaction behavior.
Why This Change Was Made
Consolidate private interaction failure replies in one Discord-owned helper and reuse the canonical presentation action-value resolver plus shared Discord select/button builders. Preserve authorization and per-user allowlist checks before consuming persisted interactions, existing ephemeral failure text and expired-interaction handling, exact command-versus-callback isolation, mixed-action rejection, modal behavior, authored component ordering, and five-button action rows. No public plugin SDK or configuration contracts change.
User Impact
No intended user-visible behavior change: Discord buttons, selects, modal forms, authorization denials, and private invalid/expired interaction responses continue behaving exactly as before. The Discord plugin loses 92 production lines (+90/-182 across six files) while retaining the same component rendering and delivery semantics.
Evidence
pnpm check:changed: passed, including extension production/test typechecks, formatting, plugin/API boundaries, dead-export scan, dependency guards, changed-file lint (0 warnings/errors), database/media/runtime sidecar guards, and runtime import-cycle checks.codex, modelgpt-5.6-sol, thinkingxhigh; no accepted/actionable findings, patch correctness confidence 0.99.Exact-head Discord interaction production proof
Twelve actual committed production modules were checked against their exact Git object bytes, source-transpiled, and executed through the real Discord DM authorization owner, allowed-user enforcement, component/modal handlers, registry consumption, and canonical presentation normalization. Interaction objects and Discord transport were synthetic in-memory fixtures; no live account, credentials, network, or gateway were touched.
{ "head":"c0dbcc586f9ff0ce9e5d4bb883fa1b350291237b", "committedProductionModulesVerified":12, "authorizedCommand":{"dmAuth":"allow","allowedUsers":["111"],"consume":[false,true],"reply":{"content":"✓","ephemeral":true},"dispatched":"/status","pluginCallbackAuthorized":true}, "expiredComponent":{"reply":{"content":"This component has expired.","ephemeral":true},"dispatched":false}, "unauthorizedDm":{"reply":{"content":"You are not authorized to use this button.","ephemeral":true},"consumed":false}, "deniedAllowedUsers":{"reply":{"content":"You are not authorized to use this button.","ephemeral":true},"consumed":false}, "modalTrigger":{"shown":"Deploy configuration","componentConsumed":true}, "modalSubmission":{"callback":"deploy:confirm","event":"Form \"Deploy configuration\" submitted.\n- Environment: production","consumed":true}, "expiredModal":{"reply":{"content":"This form has expired.","ephemeral":true}}, "expiredReplyRejection":"swallowed", "mixedCommandCallbackSelect":"rejected", "buttonRows":[5,2], "assertions":"PASS" }All actual production handler assertions passed: successful authorized component dispatch, private expiration and unauthorized replies, modal submission, authorization-before-consumption, mixed action rejection, and safe button-row splitting. This directly fulfills the requested redacted after-fix Discord interaction proof at the unchanged reviewed commit.