Back to catalog

noahchalifour /

noahchalifour/dsh-anthropic-image-clamp

Verified

DeepSeek Harness plugin: downscale images on Claude requests so many-image requests never hit the 2000px limit

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
READMESource: main@7a921fd7

dsh-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.

—/ 5

No ratings yet

Community comments

No comments yet. Be the first to write one.