rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:noahchalifour/dsh-anthropic-request-size-guard
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Stops this Claude error in DeepSeek Harness:
claude API error (HTTP 413): { "error": { "type": "request_too_large",
"message": "Request exceeds the maximum size" } }
Cause. The Anthropic Messages API rejects any request body over 32 MB. DSH re-sends the whole conversation every turn, including every image in history as base64. Long agent sessions that take screenshots (Android/iOS emulators, browsers) add about 1 MB per phone-sized PNG (about 1.33 MB once encoded), so after a few dozen screenshots every request fails and the session is stuck. A real stuck session had 34 screenshots at 1280×2856, for a 38 MB request.
Fix. This host plugin wraps fetch for api.anthropic.com/v1/messages
requests. A request under the budget (default 30 MB) passes through
byte-identical. A request over the budget is shrunk, cheapest step first:
Every step is deterministic and cached by content hash, so the history re-sent each turn stays byte-identical and the prompt cache keeps hitting.
dsh plugin --profile desktop add github:noahchalifour/dsh-anthropic-request-size-guard
Then restart DSH. Image re-encoding uses sharp, which DSH already ships.
Override in the profile cordis.patch.yml:
- id: anthropic-request-size-guard
config:
maxBytes: 30000000 # body budget in bytes (API limit is 32 MB)
hosts: [api.anthropic.com]
minImageBytes: 65536 # images smaller than this are never re-encoded
dropChunk: 5 # oldest images dropped per step when needed
Requests routed through a subscriptions-plugin HTTP proxy use undici's own fetch and bypass the wrapper.
npm test CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: llm、anthropic、deepseek-harness。