-
Notifications
You must be signed in to change notification settings - Fork 2
feat(messages): validate message length before sending to prevent silent Slack truncation #139
Copy link
Copy link
Closed
Description
Problem
Slack silently truncates messages exceeding 40,000 characters. When slck messages send posts a message that's too long, Slack returns ok: true with a message_truncated warning in response metadata — but slck doesn't parse that warning, so it reports success. The caller has no idea their message was cut off mid-content.
Real-world example: An AI agent used slck messages send to post a ~45K character questionnaire into a Slack thread. The message was truncated mid-word ("Extensio...") and the agent never knew.
Solution
Add client-side message length validation to messages send and messages update:
- Error by default when
textexceeds 40,000 characters (Slack's hard limit) - Actionable error message with character count and alternatives:
--file <path>to upload as a file attachmentslck canvas createto create a Slack canvas- Manual chunking suggestion
- Skip validation for file uploads (the
--filepath doesn't have this limit)
Scope
Code changes
internal/cmd/messages/messages.go—maxMessageTextLenconstant +validateMessageLength()functioninternal/cmd/messages/send.go— validation call inrunSendinternal/cmd/messages/update.go— validation call inrunUpdate- Tests for all of the above
Documentation
CHANGELOG.md— true up: collapse[Unreleased]into versioned sections ([3.2.0]for new + post-v3.1.35 work,[3.1.35]for previously released items)README.md— add Message Length Limits entry under Known Limitations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels