Repository navigation
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. by source inspection: current main has no PR rating Rank-up moves:
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. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: If maintainers accept the public field, land the narrow opt-in propagation while keeping Discord's actual consume policy in the existing component registry. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: current main has no Is this the best way to solve the issue? Yes, assuming maintainers accept the public contract addition. The PR follows the existing Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7f4462e5c06d. |
1b3e153 to
8b8b583
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Gilded Test Hopper Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
Summary
Adds
reusableto portable presentation buttons, preserves it through Discord presentation mapping, and documents the field for message presentation authors.Motivation
Closes #84182.
Presentation buttons can represent repeatable actions such as refresh or more-detail, but the portable schema and Discord mapper dropped the reusable intent before registry entries were created.
Change Type
Scope
reusable?: booleanto the presentation button type and tool schema.reusable: truefrom presentation buttons into Discord button specs.reusable?: booleanindocs/plugins/message-presentation.md.Linked Issue/PR
Closes #84182.
Real Behavior Proof
Behavior or issue addressed: A portable presentation button with
reusable: truemust keep that flag through Discord mapping and component registry dispatch so repeatable actions are not consumed after the first callback.Real environment tested: Redacted OpenClaw development checkout on this PR branch, using the Discord extension runtime path that maps presentation payloads into component entries.
Exact steps or command run after this patch: Ran a runtime diagnostic against this branch that created a reusable presentation button, mapped it to a Discord button spec, built component entries, and performed two dispatch-style lookups against the same callback data.
Evidence after fix: Redacted runtime output:
{ "componentSpecButton": { "label": "More detail", "style": "secondary", "callbackData": "detail", "reusable": true }, "entryReusable": true, "handlerConsumePolicy": false, "firstDispatch": { "label": "More detail", "callbackData": "detail" }, "secondDispatch": { "label": "More detail", "callbackData": "detail" } }Observed result after fix: The Discord button spec contains
reusable: true, the registered entry retainsentryReusable: true, handler consume policy isfalse, and both lookup attempts return the same button metadata.Not tested: No live Discord provider send was needed for this field-propagation path; the exercised behavior is the runtime mapping and registry decision that controls whether the callback is consumed.
Root Cause
Discord component entries supported reusable behavior, but portable presentation buttons had no reusable schema field and the Discord presentation mapper only copied label, style, callback data, and URL.
Regression Test Plan
pnpm exec vitest run extensions/discord/src/shared-interactive.test.ts extensions/discord/src/components.test.tsResult: 2 files passed, 15 tests passed.
User-visible / Behavior Changes
Message senders can now use
presentation.blocks[].buttons[].reusablefor Discord presentation buttons.Diagram
N/A. This is a direct schema, adapter, component-entry, and docs propagation fix.
Security Impact
No new secrets or network calls. The change only preserves an explicit boolean in already-authored message payloads.
Repro + Verification
Before this change, a presentation button authored with reusable intent could not carry that intent through the message tool schema and Discord presentation mapper. The new test asserts that the generated Discord component spec retains it, and the redacted runtime diagnostic confirms the handler sees it as non-consuming.
Evidence
Human Verification
No live Discord service is required for this field-propagation fix; the proof exercises the runtime path that decides whether an interaction callback is consumed.
Compatibility / Migration
Backward compatible. Existing payloads are unchanged unless they opt into
reusable: true.Risks
Low. The flag is only emitted when explicitly set to true.