-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
[Bug]: Cumulative images in chat history cause HTTP 400 (Max images exceeded) on plain text messages #19099
Description
Summary
When using a multimodal LLM in a long-running chat session, the agent seems to include all previously uploaded images in the context of every new request that cause LLM api reject request with 400 Bad Request
Steps to reproduce
- Start a chat session with a multimodal model (e.g., via OpenClaw/Cloud API).
- Upload and discuss several images (e.g., 2 images in 4 separate turns).
- Once 8 images have been sent in the session, send a simple text message.
- The API returns an error because the agent attempts to re-send all 8+ previous images as part of the current context.
Expected behavior
The agent should manage the context more efficiently. Possible solutions could include:
- Image Pruning: Dropping older images from the context after a certain number of turns.
- Summarization: Keeping the text description/analysis of the image but removing the heavy image data from the payload of subsequent turns.
- Configurable Limit: Allowing users to set a maximum number of historical images to be sent per request.
Actual behavior
When using a multimodal LLM in a long-running chat session, the agent seems to include all previously uploaded images in the context of every new request. Once the total number of images across the entire conversation history exceeds 8, every subsequent message (even plain text like "Hello") fails with an HTTP 400 Bad Request: "Total number of images exceeds the maximum allowed of 8".
OpenClaw version
OpenClaw 2026.2.16 (5a39e13)
Operating system
model: ollama/mistral-large-3:675b-cloud / debian 13 / Telegram chat
Install method
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response