Repository navigation
refactor(plugins): single-source interactive dispatch and its auth downgrade via plugin SDK - #120062
Merged
Merged
Conversation
…wngrade via plugin SDK
steipete
marked this pull request as ready for review
August 6, 2026 23:18
Contributor
Author
|
Incident-mode landing note (operator-directed). GitHub's declared Actions incident left this PR's core CI queued/skipped and blocked ClawSweeper; the operator directed landing without waiting. Compensating gates, all satisfied:
Production net −1 (371 deletions), tests net +7 (new seam coverage). Landed via operator-authorized admin merge at the verified head. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 7, 2026
…wngrade via plugin SDK (openclaw#120062)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Discord, Slack, and Telegram each owned a near-identical interactive plugin dispatch template: the same six-key context projection, namespace payload reconstruction, binding-helper injection, and a security-sensitive
pluginRootdowngrade. Keeping that authorization rule in three channel implementations made drift likely.The three-way preflight found one premise mismatch worth making explicit: Discord and Telegram required authorized sender + nonblank sender/account/conversation identifiers, while Slack required only authorization + its normalized base conversation. This change intentionally adopts the frozen four-factor rule for all channels, so Slack's unusual authorized callbacks with a missing sender, account, or base conversation can still reach their handler but cannot acquire conversation-binding authority.
Why This Change Was Made
createChannelInteractiveDispatchernow lives besidedispatchPluginInteractiveHandler, the runtime owner. It owns the six omitted context keys, interaction payload reconstruction, deduped dispatch, binding-helper composition, and the only productionpluginRootdowngrade. The existing Plugin SDKplugin-runtimefacade exposes the factory without adding a new import edge or public subpath.Discord and Slack map
interactiondirectly; Telegram declarescallbackMessageas the dispatch source for its publiccallback. Slack retains its channel-specific DM identity and thread/parent normalization as the optional binding-conversation override. The shared seam test covers authorized binding, unauthorized senders, missing sender/account/base conversation, and proves that a nonblank binding override cannot authorize a blank base context.User Impact
Normal interactive callbacks retain the same namespace routing, payloads, deduplication, response helpers, Telegram post-handler behavior, and Slack DM/thread binding targets. The intentional security tightening affects only Slack callbacks missing one of the canonical binding-authority identifiers: their plugin handler still runs, while binding request/detach/get helpers fail closed.
Production/tooling/generated LOC: 167 additions, 168 deletions, net -1. Tests: 210 additions, 203 deletions, net +7. The refactor removes 371 lines overall and leaves one canonical authorization rule.
Evidence
Focused behavior:
node scripts/run-vitest.mjs src/plugins/interactive.test.ts— 22 tests passed, including the SDK seam authorization table.OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 node scripts/run-vitest.mjs extensions/discord/src/monitor/monitor.test.ts extensions/slack/src/monitor/events/interactions.test.ts extensions/telegram/src/bot.test.ts— three shards passed: Discord 28, Slack 73, Telegram 134 (235 total).SDK and static checks:
pnpm plugin-sdk:api:gen— regenerated the intentionalmodule/plugin-runtimeAPI hash.pnpm plugin-sdk:surface:check— passed: 149 public entrypoints, 4,834 exports, 2,911 callable exports. The reasoned ledger rose by one public callable export.pnpm plugin-sdk:api:checkandpnpm plugin-sdk:check-exports— passed.pnpm format <touched paths>— passed.node scripts/run-oxlint.mjs <touched TypeScript/tooling paths>— passed, including Plugin SDK and Discord/Slack/Telegram declaration boundaries.git diff --check— passed.rgproof finds the four-factor condition andpluginRoot: undefinedin exactly one place:src/plugins/interactive.ts..agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output— clean; no accepted/actionable findings (patch is correct, confidence 0.97).Changed-gate note:
node scripts/check-changed.mjsdelegated to Daytona runrun_36ac970824ca/ leasecbx_9256a65a198a; the remote command exited 1 after its captured stdout showed only green lanes and a final lifecycle marker, with no stderr event. The lease was released.OPENCLAW_HEAVY_CHECK_LOCK_SCOPE=worktree OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false node scripts/check-changed.mjs) passed all guards, formatting, SDK API/surface/export checks, dead-code scans, plugin boundaries, script declarations, and core production typecheck. Core-test typecheck stopped only on three unchanged branch-baseline errors inui/src/e2e/appearance-settings-defaults.e2e.test.ts(browser/serverare undefined at lines 478, 492, and 536); that parallel-sibling file was not touched or committed here.