feat(max): make inbound attachment download cap configurable - #1837
Open
therebro13 wants to merge 1 commit into
Open
therebro13 wants to merge 1 commit into
therebro13 wants to merge 1 commit into
Conversation
The MAX platform hard-coded its inbound attachment download limit at 25 MiB, below the project-wide core.DefaultMaxAttachmentSize (50 MiB) used everywhere else. Files/images/voice larger than 25 MiB were rejected with "attachment exceeds N bytes" and never reached the agent. Default the cap to core.DefaultMaxAttachmentSize for consistency and allow a per-platform override via the max_attachment_size_mb option (MiB), matching the naming of the existing global send-side setting. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GehKUtQ1YRKccv5PbHhHix
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.
Problem
The MAX platform hard-coded its inbound attachment download limit at 25 MiB (
maxAttachmentBytesinplatform/max/max.go), below the project-widecore.DefaultMaxAttachmentSize(50 MiB) used elsewhere (e.g. the send side /max_attachment_size_mb). Any file, image, or voice message larger than 25 MiB that a user sends to a MAX bot is rejected during download withattachment exceeds N bytesand never reaches the agent — with no way to raise the limit via config.Observed in production: a ~30 MiB
.docxsent to the bot failed withmax: file download failed error="attachment exceeds 26214400 bytes".Change
core.DefaultMaxAttachmentSize(50 MiB) instead of the hard-coded 25 MiB, so MAX is consistent with the rest of cc-connect.max_attachment_size_mb(MiB), matching the naming of the existing global send-side option.0/unset keeps the default.config.example.toml(EN + 中文) and addTestNewMaxAttachmentSize.No behaviour change for existing configs below 25 MiB; the default simply rises from 25 → 50 MiB and becomes tunable.
🤖 Generated with Claude Code
https://claude.ai/code/session_01GehKUtQ1YRKccv5PbHhHix