fix: Slack message truncation and image attachment handling#43
Open
electronicBlacksmith wants to merge 1 commit intoghostwright:mainfrom
Open
Conversation
When responses exceed Slack's 3000-char block limit, messages were silently truncated. Now splits into threaded overflow messages with feedback buttons attached to the final chunk. Also adds image attachment processing: PNG/JPEG/GIF/WebP files shared in Slack are downloaded, validated (path traversal + SSRF checks), and passed to the agent as file paths. Unsupported file types get a friendly skip message. Old uploads are cleaned up after 24 hours. - updateWithFeedback() refactored for multi-chunk thread replies - postToChannel() accepts optional threadTs for threading - New slack-files.ts: downloadSlackFiles(), ensureUploadsDir(), cleanupOldUploads() - Added files:read scope to slack-app-manifest.yaml - Attachment paths injected into prompt for agent Read tool access
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.
What Changed
Message truncation fix:
updateWithFeedback()refactored for multi-chunk thread repliespostToChannel()accepts optionalthreadTsfor threadingImage attachment processing:
slack-files.ts:downloadSlackFiles(),ensureUploadsDir(),cleanupOldUploads()files:readscope toslack-app-manifest.yamlIntegration:
Why
Long agent responses were silently truncated at Slack's block character limit, losing content. Image attachments shared in Slack threads were silently dropped with no feedback to the user.
How I Tested
bun test src/channels/__tests__/slack-files.test.ts- 27 pass (download, validation, cleanup, SSRF, path traversal)bun test src/channels/__tests__/slack-formatter.test.ts- 20 pass (split, truncation)bun test src/channels/__tests__/slack.test.ts- 38 pass (threading, attachments, feedback)bun run lint- cleanbun run typecheck- cleanChecklist
bun test)bun run lint)bun run typecheck).envfiles included