Skip to content

feat(slack): support blocks in plugin send action#18268

Closed
Solvely-Colin wants to merge 1 commit into
openclaw:mainfrom
Solvely-Colin:codex/slack-plugin-send-blocks
Closed

feat(slack): support blocks in plugin send action#18268
Solvely-Colin wants to merge 1 commit into
openclaw:mainfrom
Solvely-Colin:codex/slack-plugin-send-blocks

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Why

Slack Block Kit support should work not only from direct tool calls, but also from the channel plugin action adapter (action: send).

Dependency

What This PR Adds

  • In /Users/solvely/Projects/OpenClaw/src/plugin-sdk/slack-message-actions.ts:

    • send action now accepts optional blocks.
    • blocks can be JSON string or array.
    • validates blocks shape (array) and JSON parse errors.
    • validates at least one of message, blocks, or media is present.
    • forwards normalized payload to Slack tool invoke (sendMessage).
  • In /Users/solvely/Projects/OpenClaw/src/channels/plugins/actions/actions.test.ts:

    • adds Slack adapter tests for:
      • forwarding blocks from JSON string
      • forwarding blocks from array
      • rejecting invalid blocks JSON

Behavior

  • Existing send behavior remains unchanged for text/media.
  • Plugin callers can now provide Block Kit blocks consistently.

Validation

  • pnpm test src/channels/plugins/actions/actions.test.ts
  • pnpm check

Reviewer Focus

  • src/plugin-sdk/slack-message-actions.ts
  • src/channels/plugins/actions/actions.test.ts

Greptile Summary

This PR fixes a this binding issue when calling the viewClosed method on Slack's Bolt App. The change extracts the typed app object into a variable (appWithViewClosed) and calls viewClosed as a method on that object, rather than extracting the function reference and calling it standalone.

Note: The PR description mentions adding Slack Block Kit support to plugin send actions, but those changes are not present in this PR. The actual change is limited to the viewClosed method binding fix in src/slack/monitor/events/interactions.ts.

  • Fixed this binding preservation by calling appWithViewClosed.viewClosed(...) as a method instead of extracting and calling the function
  • No logical issues found with the implementation
  • The fix properly addresses the issue identified in the previous review thread

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a straightforward bug fix that properly preserves method binding by storing the typed object reference and calling viewClosed as a method. The fix directly addresses the this binding issue identified in previous review, and the implementation is correct. The only concern is the PR description mismatch, but the actual code change itself is sound.
  • No files require special attention

Last reviewed commit: e32a5ad

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack agents Agent runtime and tooling size: XL labels Feb 16, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment thread src/slack/monitor/events/interactions.ts Outdated
@Solvely-Colin
Solvely-Colin force-pushed the codex/slack-plugin-send-blocks branch from 1f9f8e4 to eaf2ee6 Compare February 16, 2026 23:03
@steipete steipete closed this Feb 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed agents Agent runtime and tooling size: XL labels Feb 16, 2026
@Solvely-Colin
Solvely-Colin force-pushed the codex/slack-plugin-send-blocks branch from eaf2ee6 to e32a5ad Compare February 17, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants