AgnesAI-Models icon indicating copy to clipboard operation
AgnesAI-Models copied to clipboard

agnes-3.0-flash: undocumented hard limit of 4 images per request breaks conversations permanently

Open wtd218 opened this issue 1 month ago • 1 comments

Summary

The agnes-3.0-flash text/multimodal chat endpoint rejects any request that carries more than 4 images, with an undocumented 400 error. This limit is not mentioned anywhere in the official docs. Because chat clients resend the whole conversation history (including images) on every turn, once a conversation accumulates a 5th image every subsequent turn fails permanently — the conversation cannot be recovered without starting over.

Environment

  • Base URL: https://apihub.agnes-ai.com/v1 (OpenAI-compatible)
  • Endpoint: POST /v1/chat/completions
  • Model: agnes-3.0-flash
  • Tested with 64x64 PNG images sent as image_url (data URI), 5 distinct images

Steps to reproduce

  1. Send POST /v1/chat/completions with model: agnes-3.0-flash and a user message whose content array contains:
    • one {"type":"text",...} block
    • N {"type":"image_url","image_url":{"url":"data:image/png;base64,..."}} blocks
  2. Repeat with N = 4 and N = 5.

Expected vs actual

N (images in one request) Result
4 200 OK (works)
5 400 Bad Request

Actual response at N = 5:

{
  "error": {
    "code": "400",
    "message": "Agnes: ***.BadRequestError: OpenAIException - {\"object\":\"error\",\"message\":\"Image count 5 exceeds limit 4 per request.\",\"type\":\"BadRequestError\",\"param\":null,\"code\":400}",
    "param": null,
    "type": "invalid_request_error"
  }
}

Why this is a problem

  • The limit is 4 images per request, but this is undocumented (absent from the model page, error-code page, and Token Plan FAQ).
  • Standard chat/agent clients (OpenAI-compatible SDKs, agent harnesses) resend all prior images in history on each turn. So a conversation that ever holds 5 images gets stuck in a permanent 400 loop; the only workaround a client can apply is to drop/offload older images — which it cannot do correctly without knowing the limit up front.
  • Note this is a per-request count, and it also counts images resent from history, not just newly attached ones.

Suggestions

  1. Document the limit on the agnes-3.0-flash model page and the error-code page (state clearly that it counts images resent in history too).
  2. Preferably, raise or make the limit configurable — 4 is very low for agent/multi-image workflows.
  3. Return a distinct, machine-readable error code (e.g. image_count_exceeded with max_images / actual_images fields) so clients can detect it and auto-offload older images instead of treating it as a generic prepended-string 400.

Thank you!

wtd218 avatar Oct 28 '26 10:10 wtd218

Thank you for the detailed feedback and suggestions. We’ve noted your comments on the image limit, documentation, and error handling, and will share them with our product and engineering teams for review. We appreciate your input and support.

Agnes-Yn avatar Oct 30 '26 01:10 Agnes-Yn