fix: split Block Kit sections exceeding 3000-char limit#123
Merged
Conversation
Section blocks have a 3000-character text limit. buildDefaultBlocks was putting the entire message into a single section block, causing Slack to reject messages exceeding this limit with invalid_blocks. Split long text across multiple section blocks, breaking at newlines to avoid splitting mid-line.
GetAPIToken() now checks SLACK_API_TOKEN env var before keychain, matching GetUserToken() behavior. This allows automation tools to inject their own tokens via env vars without conflicting with locally stored keychain credentials.
rianjs
added a commit
that referenced
this pull request
Mar 23, 2026
Add missing documentation for emoji list, files download, whoami, --channel and --file flags on messages send. Add emoji:read and files:read OAuth scopes to manifest. Update CHANGELOG with entries for recent features (#120, #122, #123, #125, #126, #130). Add integration test sections for emoji, files, identity, and --channel.
3 tasks
rianjs
added a commit
that referenced
this pull request
Mar 23, 2026
## Summary - Add missing README sections for `emoji list`, `files download`, and `whoami` commands - Document `--channel` and `--file` flags on `messages send` - Add `emoji:read` and `files:read` OAuth scopes to app manifest and scopes table - Add `emoji` → `e` alias to aliases table - Update CHANGELOG with entries for #120, #122, #123, #125, #126, #130 - Add integration test sections: Part 8 (Emoji & Files), Part 9 (Identity) - Add `--channel` flag test case to messaging section - Add `emoji:read` and `files:read` to integration test setup scopes table ## Test plan - [x] No code changes — docs only - [ ] Review README for accuracy against actual CLI behavior - [ ] Verify CHANGELOG entries reference correct PR numbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mrkdwnsection blocks, breaking at the last newline before the limit to avoid splitting mid-lineType of Change
Checklist
make test)Context
Messages over 3000 characters sent via
slck messages sendcaused Slack APIinvalid_blockserrors becausebuildDefaultBlocks()created a single section block with all the text. Slack's Block Kit enforces a 3000-character limit per section text field.The fix splits long text into multiple section blocks, breaking at the last newline before the 3000-char boundary. Existing tests updated to cover the splitting behavior.