singularity-forge/packages/pi-coding-agent/src
Tom Boucher 5f660bf3ce fix: recover from many-image dimension overflow by stripping older images (#3075)
When a session accumulates many images (screenshots, file reads), the
Anthropic API enforces a 2000px dimension limit for "many-image requests"
and returns a 400 error. Previously this error was not classified as
retryable, causing the session to get permanently stuck in an error loop
with no recovery path.

This adds automatic recovery: detect the specific "image dimensions exceed
max allowed size for many-image requests" error, strip older images from
the conversation history (keeping the 5 most recent), and auto-retry.
Also handles manual retry (continue/retry) by downsizing before retrying.

Closes #2874

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 14:40:35 -06:00
..
cli feat: Wire --bare mode across headless → pi-coding-agent → resource-loa… 2026-03-26 11:39:25 -06:00
core fix: recover from many-image dimension overflow by stripping older images (#3075) 2026-03-30 14:40:35 -06:00
modes fix: recover from many-image dimension overflow by stripping older images (#3075) 2026-03-30 14:40:35 -06:00
resources/extensions/memory refactor(test): replace try/finally with beforeEach/afterEach in packages tests (#2390) 2026-03-24 21:34:10 -06:00
tests fix: normalize Windows paths in LLM-visible text to prevent bash failures (#874) (#884) 2026-03-17 09:02:23 -06:00
utils fix(windows): prevent EINVAL by disabling detached process groups on Win32 (#2744) 2026-03-26 16:08:03 -06:00
cli.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
config.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
index.ts feat: Added RPC protocol v2 types, init handshake with version detectio… 2026-03-26 11:01:58 -06:00
main.ts feat: Wire --bare mode across headless → pi-coding-agent → resource-loa… 2026-03-26 11:39:25 -06:00
migrations.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00