feat(slack): centralize Block Kit input validation#18284
Closed
Solvely-Colin wants to merge 1 commit into
Closed
Conversation
This was referenced Feb 16, 2026
Solvely-Colin
force-pushed
the
codex/slack-blocks-input-validation
branch
from
February 16, 2026 23:03
3986c59 to
eaf2ee6
Compare
Solvely-Colin
force-pushed
the
codex/slack-blocks-input-validation
branch
from
February 17, 2026 00:55
eaf2ee6 to
ca522b1
Compare
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.
Why
Block Kit input parsing/validation is currently duplicated across tool and plugin paths. A shared validator keeps behavior consistent and prevents malformed/empty block payloads from reaching Slack APIs.
Dependency
3986c59ad.What This PR Adds
/Users/solvely/Projects/OpenClaw/src/slack/blocks-input.ts/Users/solvely/Projects/OpenClaw/src/slack/blocks-input.test.tsValidation rules now centralized:
blocksJSON must parseblocksmust be an arrayblocksmust be non-emptytypeIntegrations updated to use the shared parser:
/Users/solvely/Projects/OpenClaw/src/agents/tools/slack-actions.ts/Users/solvely/Projects/OpenClaw/src/plugin-sdk/slack-message-actions.tsAdditional regression coverage:
/Users/solvely/Projects/OpenClaw/src/agents/tools/slack-actions.e2e.test.ts/Users/solvely/Projects/OpenClaw/src/channels/plugins/actions/actions.test.tsBehavior
Validation
pnpm test src/slack/blocks-input.test.ts src/channels/plugins/actions/actions.test.tspnpm exec vitest run --config vitest.e2e.config.ts src/agents/tools/slack-actions.e2e.test.tspnpm checkReviewer Focus
src/slack/blocks-input.tssrc/slack/blocks-input.test.tssrc/agents/tools/slack-actions.tssrc/plugin-sdk/slack-message-actions.tsGreptile Summary
This PR fixes a JavaScript
this-binding bug insrc/slack/monitor/events/interactions.ts. The previous code destructured theviewClosedmethod from the app object into a standalone variable, which lost thethiscontext when invoked. The fix keeps the method on its parent object (appWithViewClosed.viewClosed(...)instead of the bareviewClosed(...)call), ensuring properthisbinding at call time.viewClosedis now invoked as a method onappWithViewClosedrather than as a detached function, preserving method bindingviewClosedbinding fixConfidence Score: 5/5
Last reviewed commit: ca522b1