Summary
The tools.media.image.maxBytes config setting exists in the schema but is not wired into the actual inbound image processing pipeline. Large images from messaging platforms (e.g., Slack) crash the LLM request because they exceed the API's base64 size limits.
Expected Behavior
Setting tools.media.image.maxBytes = 3000000 (3MB) should cause images over that threshold to be automatically resized before being sent to the LLM.
Actual Behavior
The setting is ignored. The code uses a hardcoded constant instead:
Evidence
/dist/media/constants.js hardcodes:
export const MAX_IMAGE_BYTES = 6 * 1024 * 1024; // 6MB
/dist/agents/pi-embedded-runner/run/attempt.js:624 uses the hardcoded constant:
maxBytes: MAX_IMAGE_BYTES, // Uses hardcoded constant, NOT config
/dist/agents/pi-embedded-helpers/images.js - sanitizeSessionMessagesImages calls sanitizeContentBlocksImages without passing opts.maxBytes, so it defaults to the hardcoded 5MB.
Suggested Fix
The config value config.tools?.media?.image?.maxBytes should be read and passed through to:
detectAndLoadPromptImages in attempt.js
sanitizeSessionMessagesImages in pi-embedded-helpers/images.js
sanitizeContentBlocksImages in tool-images.js
Reproduction
- Configure
tools.media.image.maxBytes = 3000000 (3MB)
- Send a 3.5MB image via Slack DM
- Agent crashes because the image isn't resized before hitting the LLM
Workaround
Manually edit /dist/media/constants.js to lower MAX_IMAGE_BYTES (gets overwritten on updates).
Environment
- Clawdbot version: 2026.1.24-3
- Channel: Slack (Socket Mode)
- Model: anthropic/claude-opus-4-5
Summary
The
tools.media.image.maxBytesconfig setting exists in the schema but is not wired into the actual inbound image processing pipeline. Large images from messaging platforms (e.g., Slack) crash the LLM request because they exceed the API's base64 size limits.Expected Behavior
Setting
tools.media.image.maxBytes = 3000000(3MB) should cause images over that threshold to be automatically resized before being sent to the LLM.Actual Behavior
The setting is ignored. The code uses a hardcoded constant instead:
Evidence
/dist/media/constants.jshardcodes:/dist/agents/pi-embedded-runner/run/attempt.js:624uses the hardcoded constant:/dist/agents/pi-embedded-helpers/images.js-sanitizeSessionMessagesImagescallssanitizeContentBlocksImageswithout passingopts.maxBytes, so it defaults to the hardcoded 5MB.Suggested Fix
The config value
config.tools?.media?.image?.maxBytesshould be read and passed through to:detectAndLoadPromptImagesinattempt.jssanitizeSessionMessagesImagesinpi-embedded-helpers/images.jssanitizeContentBlocksImagesintool-images.jsReproduction
tools.media.image.maxBytes = 3000000(3MB)Workaround
Manually edit
/dist/media/constants.jsto lowerMAX_IMAGE_BYTES(gets overwritten on updates).Environment