noahchalifour/dsh-anthropic-image-clamp ↗★ 0
dsh-anthropic-image-clamp
DeepSeek Harness host plugin: downscale inline images on Anthropic Messages requests so many-image requests never exceed the 2000px per-side limit. 适合在单次会话中发送超过20张图片,且使用Claude模型导致请求报错的用户。
설치
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:noahchalifour/dsh-anthropic-image-clampdsh-anthropic-image-clamp
Stops this Claude error in DeepSeek Harness:
messages.N.content.M.image.source.base64.data: At least one of the image
dimensions exceed max allowed size for many-image requests: 2000 pixels
Cause. Anthropic allows up to 8000px per side, but a request carrying more than 20 images is capped at 2000px per side. DSH normalizes attachments to a 2048×2048 pixel budget (8192px long edge), so a phone screenshot such as 1080×2400 is stored as-is. Once a session's history holds more than 20 images, every request fails.
Fix. This host plugin wraps fetch for api.anthropic.com/v1/messages
requests and downscales any inline base64 image whose longer side exceeds
maxDimension (default 2000). The results are deterministic and cached by
content hash, so re-sent history stays byte-identical and the prompt cache
still hits.
Install, then restart DSH:
dsh plugin --profile desktop add github:noahchalifour/dsh-anthropic-image-clamp
Config override (profile cordis.patch.yml):
- id: anthropic-image-clamp
config: { maxDimension: 1568, hosts: [api.anthropic.com] }
Limitation: requests routed through a subscriptions-plugin HTTP proxy use undici's own fetch and bypass the wrapper. No proxy is configured on this machine.