-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Problem (one or two sentences)
While working with models that read images (ex: Claude 4.x) from MCP servers or file system, internal limitations of models regarding max image count in context window, are not taken in account.
For instance, Claude 4.x enforces a hard limit of 20 images maximum in the context window that generates this kind of errors:
API Request Failed
Unknown Error: The model returned the following errors: too many images and documents: 21 + 0 > 20
Ability to trim the oldest image(s) of the context window would be beneficial: could be either automatic (prefered) or through a specific compaction commmand.
This issue is limiting the ability of Roo Code to be used for significant browser based test campaigns especially.
Context (who is affected and when)
All Roo Code users that heavily rely on model image reading capability.
Reproduction steps
- Ask Roo to test an application with its browser_action tool,
- Ask for an extensive test that will take more than 20 browser viewport screenshots
- Observ the error
Expected result
When a new image must be added to a context window that reached its own image limit, the latest one must be trimmed with warning to the user.
Actual result
Fatal error forcing to stop the current session.
Variations tried (optional)
No way to circumvent the issue.
App Version
3.28.18
API Provider (optional)
AWS Bedrock
Model Used (optional)
Claude 4.x Sonnet models (but not specifc to)
Roo Code Task Links (optional)
No response
Relevant logs or errors (optional)
API Request Failed
Unknown Error: The model returned the following errors: too many images and documents: 21 + 0 > 20Metadata
Metadata
Assignees
Labels
Type
Projects
Status