anomalyco / anomalyco/opencode

core: request accumulates 52 images, exceeds provider max of 50

Open
#47,721 1 comment 0 reactions 1 assignee View on GitHub

@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/plugin or .opencode/plugins; config has minimax provider + exa remote MCP only)

Reproduction

  1. In one session, iteratively build HTML visuals rendered via headless Chrome.
  2. Have the agent read PNG/GIF outputs after each iteration (hero-banner.png, anatomy-eta.png, decision-2am.png, plus GIF previews).
  3. After ~10-15 image reads across turns, any new request fails.
  4. 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 read tool 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.