Repository navigation
fix(widgets): route show_widget through Discord Activities - #126294
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
33d0e42 to
620ac71
Compare
|
Codex review: found issues before merge. Reviewed August 19, 2026, 7:46 AM ET / 11:46 UTC. ClawSweeper reviewWhat this changesThe PR moves Discord widget presentation onto the generic plugin presenter contract and makes Activity endpoints externally return 404 until a complete enabled Discord Activities account is available. Merge readinessThe repaired route gate now fails closed for unusable Activities accounts, but the PR still leaves two operator-facing documentation claims stale. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherA Discord-originated agent run exposes the core show-widget tool, which selects an eligible current-channel presenter. The Discord Activities plugin resolves the account, delivers the launch component, and handles public Activity HTTP requests. flowchart LR
A[Discord-originated run] --> B[Core show-widget tool]
B --> C[Current-channel presenter]
C --> D[Discord Activities delivery]
D --> E[Launch component message]
F[Activity HTTP request] --> G[Complete account gate]
G --> H[Activity response or 404]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +250, Tests +755, Docs +7, Generated 0, Other -5. Total +1007 across 51 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Update the Activities documentation to distinguish static internal registration from externally hidden 404 behavior, and remove the obsolete missing-secret log instruction. Do we have a high-confidence way to reproduce the issue? Yes—source and regression tests show static route registration followed by an unhandled/404 result whenever no complete enabled account resolves. Is this the best way to solve the issue? Yes for the route-gate repair: all public entry paths now use the same complete-account resolver; the remaining work is documentation alignment. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a7f9a7fdd4fe. 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
HistoryReview history (2 earlier review cycles)
|
|
@clawsweeper re-review Resolved the reviewed-head route-gating finding. The public Discord Activity prefix now remains externally unregistered unless at least one runtime-enabled account resolves a complete Activities configuration, including its client secret. The HTTP regression table covers both an absent Activities block and an unresolved secret; the process proof now emits progress while the isolated Gateway is running. Exact local proof on this head:
The OAuth click-through remains the previously disclosed proof gap because no dedicated Discord Activity credentials were available; the real plugin, HTTP route, SQLite Activity state, component encoding, Discord REST boundary, receipt, gating, and inline Canvas sibling path are exercised. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review Resolved the second route-gating finding on the new head. Public Activity-route availability now delegates to the same complete account resolver used by OAuth/token exchange and presentation, so it requires an enabled unique account, available bot credential, enabled Activities config, resolved client secret, and application ID. Added the unresolved bot SecretRef case to the public-prefix 404 regression table. Exact proof after this repair:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
aab1ba8 to
34d0303
Compare
|
Land-ready proof for exact head
ClawSweeper dispositions and rank-up moves:
Production LOC: +682/-432 (net +250). Tests/test-support: +1,271/-516 (net +755). Docs: +34/-27. Generated/ratchet metadata: +15/-20. The production growth is the generic presenter and delivery contract replacing the deleted Discord-owned tool/alias path. Remaining proof gap: no real Discord OAuth Activity launch/click was run because dedicated Discord application credentials were unavailable. The isolated proof covers the real Gateway, plugin, HTTP route, SQLite Activity state, component encoding, Discord REST boundary, receipt, account/secret gating, and inline Canvas sibling path. |
|
Merged via squash.
|
…126294) * refactor(widgets): unify Discord presentation * fix(discord): keep incomplete Activity routes private * fix(discord): require usable Activity accounts * docs(discord): clarify hidden Activity routes
What Problem This Solves
Resolves a problem where
show_widgethad two architectural owners: core owned inline and dashboard widgets while the Discord plugin registered a second tool with the same name plus the beta-onlydiscord_widgetalias. Core then hard-coded Discord out of its normal tool path to avoid a collision, leaving schemas, limits, results, policy, and delivery behavior split across two implementations.Why This Change Was Made
This makes core the sole model-facing owner of
show_widgetand turns Discord Activities into a contextual presenter behind that tool. Core now owns schema validation, registered content kinds, canonical document composition, dashboard pinning, destination selection, and failure semantics; Discord keeps Activity storage, account/channel binding, component delivery, OAuth and instance checks, and one-use document capabilities.The refactor also removes
discord_widget, deletes Discord's tool manifest claims and policy exception, preserves request-scoped plugin registry precedence, and adopts full-only presenter registrations only from matching lifecycle owners. Activity registration is static because plugin startup precedes publication of secret-owned channel fields; route and presenter availability remain gated by the current authored/runtime configuration, and an unconfigured Activity prefix remains externally indistinguishable from an unregistered route.AI-assisted implementation; the resulting source, tests, runtime behavior, and generated metadata were reviewed and verified before publication.
User Impact
Agents use one
show_widgetcall on every supported surface. In a configured Discord channel, that call posts an Open widget Activity card automatically; inline-capable clients still receive the Canvas widget; unsupported channels do not receive the tool. Dashboard pin/name/tab/size/frame/capability fields now remain available when Discord is the presentation destination.The
discord_widgetalias is removed. It existed only in beta tags and has no stable-release compatibility obligation.Release-note context: Discord Activity widgets now use the canonical core
show_widgettool and schema; the deprecated beta-onlydiscord_widgetalias is gone.Evidence
node scripts/run-vitest.mjs src/canvas/widget-tool.test.ts src/canvas/widget-tool.presenter.test.ts src/agents/openclaw-tools.registration.test.ts src/agents/tool-policy-pipeline.test.ts src/agents/embedded-agent-subscribe.handlers.tools.test.ts src/plugins/registry.widget-presenter.test.ts extensions/canvas/src/widget-presenter.test.ts extensions/discord/src/activities extensions/discord/src/send.components.test.tsnode scripts/run-vitest.mjs src/plugins/registry.widget-presenter.test.ts src/agents/runtime-plugins.test.ts src/agents/openclaw-tools.registration.test.tsOPENCLAW_E2E_SKIP_BUILD=1 node scripts/run-vitest.mjs test/e2e/qa-lab/plugins/discord-show-widget-contextual-presenter.e2e.test.tsshow_widgetfor configured Discord context./tools/invoke, redirected only Discord REST to loopback, and observed the actual component payload, nonce, fixed Open widget custom ID, generic card receipt, and persisted delivery marker.inline-widgetsGateway client still receives anassistant_messageCanvas result.node scripts/run-vitest.mjs src/agents/embedded-agent-subscribe.handlers.tools.test.ts test/e2e/qa-lab/plugins/discord-show-widget-contextual-presenter.e2e.test.tsmessage_tool_onlysource-delivery accounting.pnpm buildpnpm plugin-sdk:surface:checkpnpm docs:list && pnpm docs:check-mdx && pnpm docs:check-linkspnpm plugins:inventory:check && pnpm channels:catalog:check && pnpm check:bundled-channel-config-metadatanode scripts/check-changed.mjs.claude/skills/autoreview/scripts/autoreview --mode uncommitted --max-priority P1 --model gpt-5.6-sol --thinking highProof gap: this exercises the real Gateway, plugin, serializer, receipt, and storage paths up to a simulated Discord REST boundary. A real Discord OAuth Activity launch/click was not run because this checkout has no dedicated Discord application credentials.