You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mcp: binary file attachment in tool result permanently breaks the session #52448
An MCP tool result with a type: "file" content item whose media type the provider can't inline (e.g. application/vnd.apache.parquet) is persisted into session history. The next model request fails:
AI.Error: OpenAI Chat does not support media type application/vnd.apache.parquet
at OpenAIChat.lowerMedia
at OpenAIChat.lowerToolMessages
Every later turn in that session fails the same way while replaying history — the session becomes permanently unusable, even for unrelated messages. Expected: unsupported file items dropped or converted to text at persistence time (byte materialization to a local file would be a bonus), or tolerated during lowering.
OpenCode version
2.0.21
Steps to reproduce
Configure an MCP server whose tool returns a binary attachment (a file read returning { type: "file", mime: "application/vnd.apache.parquet", uri: "data:...;base64,..." } works).
Call it in a session on an OpenAI Chat provider.
Tool completes, then every request — including follow-ups about something else — fails with the error above.
I reproduced this in v2's Chat request compiler with Parquet and CSV and opened #52517. The fix keeps the original files in history and sends Chat an omission note instead, so follow-ups can continue. The compiled Parquet and follow-up requests also completed against OpenAI. If you can try it with your MCP server, let me know how it goes.
Activity
github-actions commentedon Oct 1, 2026
This issue might be a duplicate of existing issues. Please check:
vladislav-miroshnikov commentedon Oct 1, 2026
I reproduced this in v2's Chat request compiler with Parquet and CSV and opened #52517. The fix keeps the original files in history and sends Chat an omission note instead, so follow-ups can continue. The compiled Parquet and follow-up requests also completed against OpenAI. If you can try it with your MCP server, let me know how it goes.