Skip to content

fix(slack): add blocks+media send guardrails#18290

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

fix(slack): add blocks+media send guardrails#18290
Solvely-Colin wants to merge 1 commit into
openclaw:mainfrom
Solvely-Colin:codex/slack-blocks-media-guardrails

Conversation

@Solvely-Colin

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

Copy link
Copy Markdown
Contributor

Why

Slack API does not support mixing rich Block Kit blocks with file-upload media sends in our current send flow. We already enforce this lower in send.ts; this PR adds earlier guardrails in tool/plugin layers for faster, clearer failures.

Dependency

What This PR Adds

  • In /Users/solvely/Projects/OpenClaw/src/agents/tools/slack-actions.ts:

    • reject sendMessage when both mediaUrl and blocks are provided
  • In /Users/solvely/Projects/OpenClaw/src/plugin-sdk/slack-message-actions.ts:

    • reject plugin send when both media and blocks are provided
  • Tests added:

    • /Users/solvely/Projects/OpenClaw/src/agents/tools/slack-actions.e2e.test.ts
    • /Users/solvely/Projects/OpenClaw/src/channels/plugins/actions/actions.test.ts

Behavior

  • Valid text/media-only and text/blocks-only sends remain unchanged.
  • Invalid mixed blocks + media now fails earlier with clear errors.

Validation

  • pnpm test src/channels/plugins/actions/actions.test.ts
  • pnpm exec vitest run --config vitest.e2e.config.ts src/agents/tools/slack-actions.e2e.test.ts
  • pnpm check

Reviewer Focus

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

Greptile Summary

Despite the PR title referencing "blocks+media send guardrails," the actual diff in this PR is a single commit (eaf2ee66) that fixes viewClosed method binding in src/slack/monitor/events/interactions.ts. The other changes mentioned in the description belong to dependent PRs.

  • Method binding fix: The viewClosed method on the Slack Bolt app was previously destructured into a standalone variable, losing its this context. The fix stores the cast object reference (appWithViewClosed) and calls the method on it directly (appWithViewClosed.viewClosed(...)), preserving proper method binding.
  • No logic changes, no new features — this is a targeted correctness fix for method invocation.

Confidence Score: 5/5

  • This PR is safe to merge — it's a minimal, correct fix that preserves method binding without changing any behavior.
  • The change is a 2-line refactor that replaces destructured method extraction with a proper method call on an object reference. It preserves the existing type cast, guard check, and invocation pattern. No new logic is introduced, no existing behavior is altered for working cases, and the fix addresses a real potential runtime issue (lost this binding).
  • No files require special attention.

Last reviewed commit: 1126db4

@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.

13 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment thread src/slack/monitor/slash.ts Outdated
Comment thread src/slack/monitor/slash.test.ts
@Solvely-Colin
Solvely-Colin force-pushed the codex/slack-blocks-media-guardrails branch from c33d231 to eaf2ee6 Compare February 16, 2026 23:03
@steipete steipete closed this Feb 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed agents Agent runtime and tooling size: XL labels Feb 16, 2026
@steipete steipete reopened this Feb 17, 2026
@Solvely-Colin
Solvely-Colin force-pushed the codex/slack-blocks-media-guardrails branch from eaf2ee6 to 1126db4 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