Repository navigation
feat: Slack inbound file sharing — images via vision, text files via container (#222) - #235
Merged
Merged
Conversation
Enable Slack users to upload files that agents can process. Images are
embedded as base64 data URIs for Claude vision. Text files (CSV, JSON,
TXT, etc.) are copied into per-session container directories via Docker
put_archive API.
Security:
- Filename sanitization (path traversal prevention, hidden file rejection)
- Per-user file upload rate limiting (5 files/min)
- Size caps: 5MB per image, 10MB per file, 10MB total inline images
- Max 10 files per message
- Unsupported formats rejected with user message (PDF, archives, video, audio)
- Per-session upload dirs cleaned up after execution (all exit paths)
Architecture:
- FileAttachment model + files field on NormalizedMessage (channel-agnostic)
- adapter.download_file() — each channel implements its own download auth
- files:read OAuth scope added for Slack workspace installs
- container_put_archive() async wrapper in docker_utils
- Task execution logging: timeout, HTTP status, elapsed time
Tests: 36 unit tests covering sanitization, type routing, size limits,
extraction, rate limiting, session directories
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- requirements.md: Added SLACK-FILES requirement (§15.1b-iii) - feature-flows/slack-file-sharing.md: Full flow document - feature-flows.md: Index updated with new flow - task_execution_service.py: Move start_time before try block (review item #3) - message_router.py: Sanitize session_id in upload path (review item #4) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
vybe
approved these changes
Mar 31, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
LGTM — approved. Branch has merge conflicts with main; please rebase before merging:
git fetch origin main && git rebase origin/main && git push --force-with-leaseNon-blocking suggestions from validation:
- Update
docs/memory/architecture.mdline ~200 to includeFileAttachmentin the base.py models list - Clarify issue #222 lifecycle: remove
Fixes #222if Phase 2 outbound work should stay tracked there - Replace
datetime.utcnow()withdatetime.now(timezone.utc)in the 3 new logging lines intask_execution_service.py(deprecated in Python 3.12+)
…container (#222) Merge of feature/222-slack-file-sharing into main. Conflict resolution: - feature-flows.md: kept both SLACK-FILES and TELEGRAM-001/FANOUT-001 changelog entries - message_router.py: retained _cleanup_uploads call + updated DONE log to [ROUTER:{channel}] format; dropped _get_bot_token and _build_session_identifier helpers (replaced by adapter.get_bot_token/get_session_identifier in the Telegram channel-agnostic refactor) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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
ReadtoolSecurity
os.path.basename+ regex strip + hidden file rejection (prevents../../.envtraversal)files:readOAuth scope added (requires Slack app reinstall)Architecture
FileAttachmentmodel +filesfield onNormalizedMessage— channel-agnosticChannelAdapter.download_file()— each channel implements own download authSlackAdapter: extracts files from all 3 event types (DM, mention, thread)container_put_archive()async Docker wrapper for file injectionTechnical findings
--allowedTools Readand agent reads a PNG → API returns 400 "Could not process image". Workaround: images go base64 inline,Readonly added for non-image files.url_private_downloadreturns HTML withoutfiles:readscope — discovered during testing.Test plan
/api/taskwithallowed_tools: [Read]/api/task— Claude describes image contentFixes #222 (Phase 1 — inbound only)
🤖 Generated with Claude Code