Skip to content

fix(slack): truncate section text when updating approval messages - #62053

Closed
b32n wants to merge 1 commit into
NousResearch:mainfrom
b32n:fix/slack-approval-update-truncation
Closed

fix(slack): truncate section text when updating approval messages#62053
b32n wants to merge 1 commit into
NousResearch:mainfrom
b32n:fix/slack-approval-update-truncation

Conversation

@b32n

@b32n b32n commented Jul 10, 2026

Copy link
Copy Markdown

Fixes #62054

What

Slack chat.update fails with invalid_blocks when updating approval or slash-confirm messages after a button click — the section block text exceeds Slack's 3000-character limit.

Why

send_exec_approval and send_slash_confirm budget content on send, but _handle_approval_action and _handle_slash_confirm_action copy original_text verbatim when rebuilding blocks after a button click.

Fix

Add _fit_slack_section_text() to clamp section mrkdwn to 3000 chars before chat.update.

How to test

pytest tests/gateway/test_slack_approval_buttons.py::TestSlackApprovalAction -v

Manual repro (production symptom):

  1. Trigger a command approval with a large execute_code script.
  2. Click "Allow Once".
  3. Message should update to show the decision; buttons removed.

Previously: invalid_blocks / must be less than 3001 characters [json-pointer:/blocks/0/text/text] — approval still resolved but UI did not update.

Platforms tested

  • macOS (pytest)

Slack chat.update fails with invalid_blocks when rebuilding approval or
slash-confirm messages after a button click if the original section text
exceeds the 3000-character Block Kit limit. send_exec_approval already
budgets content on send; mirror that on update via _fit_slack_section_text.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages duplicate This issue or pull request already exists labels Jul 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #53701 (earliest-open canonical) — same code-site and mechanism: clamp the echoed original_text to Slack's 3000-char section limit before chat.update in _handle_approval_action / _handle_slash_confirm_action. #61697 is already marked a duplicate of #53701 via this same mechanism. Both are the post-decision counterpart to the merged send-time fix #43444 (which did not cover the chat.update-rebuild path); related to the issue #53693 / #62054.

@b32n

b32n commented Jul 10, 2026

Copy link
Copy Markdown
Author

Closing this PR as it's a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/slack Slack app adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Slack approval UI fails to update when section text exceeds 3000 chars

2 participants