Preserve disabled Discord presentation buttons#84188
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. at source level. Current main types/docs already allow PR rating What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. PR egg Rarity: 🥚 common. What is this egg doing here?
Real behavior proof Mantis proof suggestion Risk before merge Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow field-propagation fix once normal CI confirms the focused Discord component and outbound-adapter regressions stay green. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main types/docs already allow Is this the best way to solve the issue? Yes. The latest head keeps the fix bounded to the existing schema, capability, mapper, and final component serialization paths, with regression coverage for callback and URL/link buttons. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 48acdd3d85ea. |
|
@clawsweeper automerge |
|
🦞🔧
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
|
ClawSweeper 🐠 reef update Thanks for the work here. ClawSweeper could not write to the source branch, so it opened a replacement PR rather than letting the fix drift. attribution still points back here. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against f01328f. |
Summary
Accepts
disabledon portable presentation buttons, advertises Discord disabled-button support during channel adaptation, and preserves the field in Discord presentation button specs.Motivation
Closes #84183.
The runtime type already included
disabled, and Discord button specs support disabled buttons, but the message tool schema and Discord presentation mapper dropped the field. The channel capabilities also failed to advertise disabled-button support, so outbound adaptation could strip the state before rendering.Change Type
Scope
disabledto the message tool presentation button schema.disabled: trueinto Discord button specs for presentation and legacy interactive button mapping.presentationCapabilities.limits.actions.supportsDisabledtotrue.Linked Issue/PR
Closes #84183.
Real Behavior Proof
Behavior or issue addressed: A portable presentation button with
disabled: truemust survive Discord capability adaptation and render as a disabled Discord component, including URL/link buttons.Real environment tested: Redacted OpenClaw development checkout on this PR branch, using the Discord outbound adapter and Discord presentation renderer.
Exact steps or command run after this patch: Ran a runtime diagnostic against this branch that read Discord presentation capabilities, adapted a disabled URL presentation button for the Discord target runtime, rendered it into a Discord component spec, and serialized the final link button component.
Evidence after fix: Redacted runtime output:
{ "supportsDisabled": true, "adaptedButton": { "label": "Open docs", "url": "https://example.com/docs", "disabled": true }, "componentSpecButton": { "label": "Open docs", "style": "link", "url": "https://example.com/docs", "disabled": true }, "serializedLinkButton": { "type": 2, "style": 5, "label": "Open docs", "disabled": true, "url": "https://example.com/docs" }, "registeredEntries": 0 }Observed result after fix: Discord advertises disabled-button support, the adapted URL button still has
disabled: true, the component spec keepsdisabled: true, and final serialized Discord link-button output includesdisabled: true.Not tested: No live Discord provider send was needed for this deterministic capability-adaptation, component-rendering, and final serialization path.
Additional non-link runtime proof from the same branch:
{ "supportsDisabled": true, "adaptedButton": { "label": "Already handled", "value": "done", "disabled": true }, "renderedButton": { "label": "Already handled", "style": "secondary", "callbackData": "done", "disabled": true } }Root Cause
The portable button type and low-level Discord builder already supported disabled buttons, but the schema, adapter capability metadata, and mapping layer did not consistently propagate that field.
Regression Test Plan
node scripts/run-vitest.mjs extensions/discord/src/shared-interactive.test.ts extensions/discord/src/outbound-adapter.test.ts extensions/discord/src/components.test.ts extensions/discord/src/send.components.test.tsResult: 4 files passed, 58 tests passed.
User-visible / Behavior Changes
Callers can send disabled Discord presentation buttons through the message tool without falling back to Discord-specific payloads.
Diagram
N/A. This is a field propagation and capability-advertisement fix.
Security Impact
No new secrets or external calls. The change reduces accidental action availability by preserving an explicit disabled state.
Repro + Verification
Before this change,
disabled: truecould be rejected or dropped before Discord rendering, and disabled URL buttons could survive adaptation but serialize as enabled link buttons. The new regression tests verify that channel adaptation keeps disabled callback and URL buttons, and final Discord link-button serialization emits a disabled component.Evidence
supportsDisabledis advertised anddisabled: truereaches final serialized Discord link-button output.Human Verification
No live Discord service is required for this deterministic channel-adaptation and rendering path.
Compatibility / Migration
Backward compatible. Existing messages render the same unless they set
disabled: true.Risks
Low. Only true values are propagated.