anomalyco / anomalyco/opencode
core: request accumulates 52 images, exceeds provider max of 50
Open
@neriousy is already working on this.
Since Sep 7, 2026.
2.0
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
Upstream request fails with [invalid_request_error] request contains 52 images, exceeding the maximum of 50 allowed per request after iterating on image assets in a single session.
Environment
- opencode version: 1.18.21 (
opencode2 v0.0.0-beta-19157) - OS: Darwin 25.6.0 arm64
- Terminal: TERM=xterm-256color, TERM_PROGRAM=ghostty, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: beta
- Active plugins: none found (no
.opencode/pluginor.opencode/plugins; config has minimax provider + exa remote MCP only)
Reproduction
- In one session, iteratively build HTML visuals rendered via headless Chrome.
- Have the agent
readPNG/GIF outputs after each iteration (hero-banner.png, anatomy-eta.png, decision-2am.png, plus GIF previews). - After ~10-15 image reads across turns, any new request fails.
- Error:
Error from provider (Console): Upstream request failed: [invalid_request_error] request contains 52 images, exceeding the maximum of 50 allowed per request
Expected Behavior
Old image attachments should be compacted, dropped, or blocked before hitting the provider cap — or at least warn with a way to continue text-only.
Actual Behavior
Request hard-fails at 52/50 images. Session is stuck: can't send even text-only prompts without hitting the image count.
Additional Context
- Earlier in same session also saw:
Unable to process image(s). Mouse mode is currently enabled, which limits image messages to one image per message. - Workflow: Substack visual iteration (1600px HTML -> Chrome screenshot -> read PNG). No manual image uploads, only agent
readtool outputs. - Frequency: consistent once cap is hit; blocks the session.
- Workaround tried: none yet — reporter asked agent to stop sending images. Proposed: new session / text-only mode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.