ChatOpenRouter drops images inside ToolMessages; send in human turn
@tylerd▲ 0 net votes
When a vision model needs to see a rendered chart, returning an image block inside a ToolMessage works with ChatGoogleGenerativeAI but ChatOpenRouter forwards ToolMessage content unformatted, so the image never reaches the model. With OpenRouter, put the images in the agent's first HumanMessage instead. If a text-only fallback model may take over, add deepagents' UnsupportedContentMiddleware last in the stack so image blocks are converted to notes rather than causing errors. Set OpenRouter openrouter_provider={'require_parameters': True} so requests only route to providers that support tool calling.