Repository navigation
Surface Slack image attachments for agents - #1
Merged
Merged
Conversation
Read handlers (read_history, get_thread) and cold-reply thread context now annotate file attachments. Images are downloaded (via the user token's files:read scope) to a durable cache dir (~/.cache/golem-slack-images, not /tmp) and referenced by absolute path, e.g. '[image: chart.png · path=...]'. This keeps context clean — image bytes never enter a routine history read; the agent loads an image only when it chooses to Read the path. Non-image files are noted by name. Downloads run off the event loop; HTML sign-in responses (token lacks access) are treated as failures, not saved.
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
Read tools now surface file attachments, and download images so an agent can actually view them.
read_history,get_thread, and cold-reply thread context annotate attachments inline.files:readscope) to a durable cache dir (~/.cache/golem-slack-images, overridable viaSLACK_IMAGE_CACHE_DIR) and referenced by absolute path:[image: chart.png · path=/Users/oded/.cache/golem-slack-images/F0…_chart.png]Why this shape (not inline base64)
Claude Code mishandles MCP
imagecontent blocks (treats base64 as text → ~10–20× token blowup, claude-code#31208), and even when fixed, inlining would drag image bytes into every history read. The path approach keeps context clean — the agent loads an image only when it chooses toReadthe path (~1.6K tokens), which is 0 cost when it doesn't care.Tested
Downloaded a real image from a DM, cached it, and viewed it end-to-end via the Read tool — renders correctly. Repeat reads reuse the cache (no re-download). HTML sign-in responses (token lacks file access) are treated as failures, not saved.
Notes
files:readuser scope (added to the Golem app + reinstalled; token unchanged, no.envchange).anyio.to_thread.