Skip to content

feat: read images, PDFs, and text files shared with the agent - #120

Draft
zimeg wants to merge 1 commit into
mainfrom
read-shared-images
Draft

zimeg wants to merge 1 commit into
mainfrom
read-shared-images

Conversation

@zimeg

@zimeg zimeg commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

This pull request reads the files people share with the coding agent, so a screenshot, log, or spec reaches the model instead of just its name.

  • A file shared with a mention, a direct message, or a message in a code channel is downloaded from url_private with the bot token, as downloading files describes. The token goes only to https://files.slack.com. Remote files, other hosts, and redirects never get it.
  • PNG, JPEG, GIF, and WebP images and PDFs go to the model as they are: image and document blocks with the Claude Agent SDK, input_image and input_file with the OpenAI Agents SDK, and BinaryContent with Pydantic AI.
  • Text files go into the prompt, clipped to about 100,000 characters with most of the end kept.
  • Any other file, or one over 5 MB, is named in the prompt as not read, with the reason, so the agent can say so.
  • Files in a code channel are read when their turn starts, after the session shows processing.
  • Every app requests the files:read scope in manifest.json and app_oauth.py. Installed apps need a reinstall to get it. Until then a shared file is named as not read because Slack redirected the download.
  • This applies to every app: claude-agent-sdk, openai-agents-sdk, and pydantic-ai.

Fixes #111.

Testing

  • Run slack run and reinstall the app when asked, for the new files:read scope.
  • In a code channel, share a screenshot of an error with "why does this fail?" and confirm the agent describes what's in it.
  • Share a text file, like a test log, and a small PDF, and confirm the agent quotes from each.
  • Share a .zip and confirm the agent says it couldn't read it.
  • Mention the agent outside a code channel with a screenshot and a question that fits a reply, and confirm the answer uses the image.
  • For pydantic-ai, repeat with both ANTHROPIC_API_KEY and OPENAI_API_KEY, since each provider reads the files its own way.

🤖 Generated with Claude Code

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment labels Dec 3, 2026
@zimeg zimeg self-assigned this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read shared files in code channels, not just their names

1 participant