GeezerVison is showing github.com — mcp: binary file attachment in tool result permanently breaks the session · Issue #52448 · anomalyco/opencode
mcp: binary file attachment in tool result permanently breaks the session #52448
Description
Description
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.
Operating System
macOS 15.6 (Darwin 24.6.0, arm64)
Terminal
xterm-256color
Activity
github-actions commented on Oct 1, 2026
This issue might be a duplicate of existing issues. Please check:
- #30249: MCP tool results with non-image binary content crash the session.
- #39824: Media in tool results can bypass model capability checks and permanently brick a session.
- #48868: A PDF tool result causes replay failures and leaves an OpenAI-compatible-provider session stuck.
- #37191: An MCP binary attachment persists in history and causes every subsequent Bedrock request to fail.
vladislav-miroshnikov commented on 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.
Metadata
Metadata
Development
No branches or pull requestsIssue actions