Skip to content

fix(slack): render markdown tables as Block Kit tables - #52746

Closed
changhow wants to merge 1 commit into
NousResearch:mainfrom
changhow:feat/slack-native-table-blocks
Closed

fix(slack): render markdown tables as Block Kit tables#52746
changhow wants to merge 1 commit into
NousResearch:mainfrom
changhow:feat/slack-native-table-blocks

Conversation

@changhow

@changhow changhow commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • convert eligible Markdown pipe tables in Slack responses into native Block Kit table blocks
  • preserve surrounding prose as Slack section blocks and keep existing text/mrkdwn fallback behavior
  • apply the conversion to normal sends, slash-command ephemeral responses, private notices, message edits, and standalone Slack delivery
  • document Slack table behavior and limits

Fixes #18918.

Note: there are older open PRs around this issue, but the active Slack implementation on main now lives under plugins/platforms/slack/adapter.py; this PR targets that current plugin path.

Behavior / safeguards

  • ignores tables inside fenced code blocks
  • falls back to the existing text path for invalid or over-limit tables
  • enforces Slack limits: 100 rows, 20 columns, 10,000 aggregate table-cell characters per message, 50 total blocks
  • uses raw_text cells after stripping Markdown delimiters that Slack table cells do not parse
  • clears stale Block Kit blocks on chat.update when the edited text no longer contains a table

Tests

  • python3 -m ruff check plugins/platforms/slack/adapter.py tests/gateway/test_slack.py
  • git show --check --pretty=format: HEAD -- plugins/platforms/slack/adapter.py tests/gateway/test_slack.py website/docs/user-guide/messaging/slack.md
  • python3 -m py_compile plugins/platforms/slack/adapter.py tests/gateway/test_slack.py
  • python3 -m pytest tests/gateway/test_slack.py tests/gateway/test_send_multiple_images.py::TestSlackMultiImage -q -o 'addopts=' — 218 passed, 38 pre-existing async mock warnings

Security / review

  • no new network destinations or credentials
  • no shell execution or dynamic code execution
  • table conversion is bounded by Slack message/table/block limits and falls back instead of sending oversized Block Kit payloads
  • independent review found the multi-table aggregate cell-character cap; fixed by tracking the 10,000-character budget across all table blocks in a single message and added regression coverage

@changhow
changhow force-pushed the feat/slack-native-table-blocks branch from 3bcbe25 to c713c4e Compare June 26, 2026 00:09
@alt-glitch alt-glitch added type/feature New feature or request comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter P3 Low — cosmetic, nice to have sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jun 26, 2026
@teknium1

teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Superseded by #56102 (#56102), a broader opt-in Slack Block Kit renderer that includes native table blocks (per-column alignment, inline-formatted cells, monospace fallback over Slack's limits) and closes #18918. This was one of several independent fixes for the same area — thanks for contributing it.

@teknium1 teknium1 closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack: render Markdown pipe tables as Block Kit tables

3 participants