Skip to content

Preserve disabled Discord presentation buttons#84188

Closed
100menotu001 wants to merge 3 commits into
openclaw:mainfrom
100menotu001:codex/discord-presentation-disabled-buttons
Closed

Preserve disabled Discord presentation buttons#84188
100menotu001 wants to merge 3 commits into
openclaw:mainfrom
100menotu001:codex/discord-presentation-disabled-buttons

Conversation

@100menotu001
Copy link
Copy Markdown
Contributor

@100menotu001 100menotu001 commented May 19, 2026

Summary

Accepts disabled on 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

  • Bug fix

Scope

  • Adds disabled to the message tool presentation button schema.
  • Copies disabled: true into Discord button specs for presentation and legacy interactive button mapping.
  • Sets Discord presentationCapabilities.limits.actions.supportsDisabled to true.
  • Adds regression coverage for the adapted outbound path and Discord render output.

Linked Issue/PR

Closes #84183.

Real Behavior Proof

Behavior or issue addressed: A portable presentation button with disabled: true must 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 keeps disabled: true, and final serialized Discord link-button output includes disabled: 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.ts

Result: 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: true could 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

  • Focused regression command passed.
  • Redacted runtime diagnostic above confirms supportsDisabled is advertised and disabled: true reaches 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.

@openclaw-barnacle openclaw-barnacle Bot added channel: discord Channel integration: discord agents Agent runtime and tooling size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 19, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

Codex review: needs maintainer review before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Summary
The PR adds disabled support to portable presentation button schema handling, Discord presentation capabilities/mapping, final Discord component serialization, and focused Discord regression tests.

Reproducibility: yes. at source level. Current main types/docs already allow disabled, while the message tool schema, Discord supportsDisabled capability, and Discord presentation mapper do not preserve it without this PR.

PR rating
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Summary: The PR is narrow, has source-backed need, includes focused tests, and supplies useful after-fix runtime output for the changed path.

What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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
✨ Hatched: 🥚 common Velvet Diff Drake

       _..------.._          
    .-'  .-.  .-.  '-.       
   /    ( * )( * )    \      
  |        .--.        |     
  |   <\   ====   />   |     
   \    '.______.'    /      
    '-._   ____   _.-'       
        `-.____.-'           
       __/|_||_|\__          
      /__.'    '.__\         
       .-----------.         
      '-------------'        

Rarity: 🥚 common.
Trait: finds missing screenshots.
Share on X: post this hatch
Copy: My PR egg hatched a 🥚 common Velvet Diff Drake in ClawSweeper.

What is this egg doing here?
  • Eggs appear after the PR passes real-behavior proof. It is here for vibes, not verdicts: it does not change labels, ratings, merge decisions, or automation.
  • The shell reacts to review momentum: open follow-up work warms it up, re-review makes it wobble, and a clean final review lets it hatch.
  • How to hatch it: reach status: 👀 ready for maintainer look or status: 🚀 automerge armed; that usually means sufficient real-behavior proof, no blocking P0/P1/P2 findings, no security attention needed, and clean correctness.
  • The hatch is seeded from this repository and PR number, so the same PR keeps the same creature; the reviewed head SHA can only change safe visual details.
  • Rarity is just collectible sparkle: 🥚 common, 🌱 uncommon, 💎 rare, ✨ glimmer, and 🌈 legendary.

Real behavior proof
Sufficient (live_output): The PR body includes redacted after-fix runtime output showing Discord capability adaptation, component spec rendering, and final serialized link-button output with disabled: true.

Mantis proof suggestion
A disabled Discord button is visible UI behavior, and a short real-transport visual would add useful confidence beyond deterministic serialization tests. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: verify a Discord presentation message with disabled callback and URL buttons renders disabled and non-clickable.

Risk before merge
Why this matters: - This read-only review did not execute the focused Vitest command; rely on CI or rerun the PR's listed node scripts/run-vitest.mjs ... command before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow field-propagation fix once normal CI confirms the focused Discord component and outbound-adapter regressions stay green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge
No repair lane is needed because the latest PR head already addresses the prior serialization gap and no blocking findings remain from this read-only review.

Security
Cleared: No dependency, workflow, secret, permission, install, or external code execution surface is changed by this patch.

Review details

Best 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 disabled, while the message tool schema, Discord supportsDisabled capability, and Discord presentation mapper do not preserve it without this PR.

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:

  • P2: This is a focused Discord presentation bug fix with limited blast radius and existing contract evidence.

What I checked:

  • Current main contract already includes disabled buttons: MessagePresentationButton already exposes disabled?: boolean, so the PR is wiring an existing presentation contract into the message tool and Discord path rather than adding a new product concept. (src/interactive/payload.ts:34, 48acdd3d85ea)
  • Current main adaptation gate drops disabled buttons unless a channel opts in: adaptButton returns no native button when button.disabled === true and limits.actions.supportsDisabled is not true, which explains why Discord must advertise support before disabled buttons survive adaptation. (src/channels/plugins/outbound/presentation-limits.ts:206, 48acdd3d85ea)
  • Current main Discord capability block does not advertise disabled-button support: Discord currently lists action limits but omits supportsDisabled, so disabled presentation buttons are downgraded before Discord rendering. (extensions/discord/src/outbound-adapter.ts:124, 48acdd3d85ea)
  • Current main Discord mapper drops the disabled field: appendDiscordPresentationButtonBlocks maps label/style/callbackData/url into DiscordComponentButtonSpec but does not copy button.disabled. (extensions/discord/src/shared-interactive.ts:147, 48acdd3d85ea)
  • Current main link-button builder can serialize disabled when the instance property is set: The internal LinkButton.serialize() includes disabled, while current main's DynamicLinkButton only copies label and url; the latest PR head adds the missing instance property assignment. (extensions/discord/src/internal/components.message.ts:52, 48acdd3d85ea)
  • Latest PR diff addresses the prior blocker: The live PR files show head fa44df3025e238efece5d8f912c6e42941ea6e8d adding override disabled = params.spec.disabled ?? false to DynamicLinkButton plus regression coverage for disabled link-button serialization. (extensions/discord/src/components.builders.ts:63, fa44df3025e2)

Likely related people:

  • steipete: GitHub path history shows repeated recent work on Discord component builders, Discord presentation helpers, and component internals, including commits that refactored/internalized the Discord component path this PR touches. (role: recent Discord component and presentation contributor; confidence: high; commits: 6346e792c46f, c76ee644c254, cea2da70492a; files: extensions/discord/src/components.builders.ts, extensions/discord/src/shared-interactive.ts, extensions/discord/src/internal/components.message.ts)
  • vincentkoc: GitHub path history shows earlier Discord shared interactive renderer and component type work that shaped the mapper/spec path being extended here. (role: shared interactive renderer contributor; confidence: medium; commits: 59d355bc4821, c7d31bae8a67, 1c78822a1f30; files: extensions/discord/src/shared-interactive.ts, extensions/discord/src/components.types.ts)
  • obviyus: GitHub history shows prior plugin SDK interactive-runtime refactoring around the shared adaptation helpers that enforce supportsDisabled. (role: adjacent plugin SDK interactive-runtime contributor; confidence: low; commits: c245c8b39d39; files: src/plugin-sdk/interactive-runtime.ts, src/channels/plugins/outbound/presentation-limits.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 48acdd3d85ea.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S proof: supplied External PR includes structured after-fix real behavior proof. and removed size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 19, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 19, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels May 19, 2026
@Takhoffman
Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 19, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

🦞🔧
ClawSweeper automerge is enabled.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-05-19 17:26:29 UTC review queued fa44df3025e2 (queued)

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 19, 2026

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.
Replacement PR: #84312
Why close: this run explicitly closes the superseded source PR after the credited replacement PR is open, so review continues in one place.
Closing this one because the run was configured to close superseded source PRs after opening the replacement.
Credit follows the fix over to the replacement PR. no sneaky treasure grab.
Co-author credit kept:

fish notes: model gpt-5.5, reasoning high; reviewed against f01328f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discord presentation buttons should preserve disabled state

2 participants