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
read: audio files are rejected as binary, so multimodal models never receive them #54491
Mime.detect (packages/core/src/mime.ts) sniffs magic bytes for PNG, JPEG, GIF, BMP, PDF, WEBP and AVIF only — there is no audio signature. An .mp3 (or .wav, .m4a, .ogg, .flac) therefore detects as application/octet-stream, misses MEDIA_MIMES, and falls through to the text path, where the first NUL byte rejects it:
So read on an audio file fails with BinaryFileError.
The rest of the pipeline already supports audio. packages/core/src/session/model-request.ts classifies a file part's mime into a modality and checks it against the model's declared capabilities:
Thanks for the detailed write-up! You're asking for the read tool to attach audio files (and also video, BMP and AVIF) when the model's capabilities.input supports them. Right now read only attaches PNG, JPEG, GIF, WebP and PDF. Everything else is detected as binary and rejected, even though the rest of the request pipeline already handles audio/ and video/ parts.
That matches the tool's current design, which supports text, images and PDFs, so we're treating this as a feature request. Maintainers will consider it.
So the gap is one set: MEDIA_MIMES in packages/core/src/tool/read-filesystem.ts and the magic-byte sniffing in packages/core/src/mime.ts both stop at images and PDF, while mimeToModality in packages/core/src/session/model-request.ts already routes audio/ and video/ parts. Fixing one without the other leaves the same class of file rejected.
Activity
opencode-agent commentedon Oct 11, 2026
Thanks for the detailed write-up! You're asking for the
readtool to attach audio files (and also video, BMP and AVIF) when the model'scapabilities.inputsupports them. Right nowreadonly attaches PNG, JPEG, GIF, WebP and PDF. Everything else is detected as binary and rejected, even though the rest of the request pipeline already handlesaudio/andvideo/parts.That matches the tool's current design, which supports text, images and PDFs, so we're treating this as a feature request. Maintainers will consider it.
Related items:
readto handle.mp4(the video part of this)readdropping audio files for MiMo V2.5read(not merged)Te-River commentedon Oct 11, 2026
Cross-referencing the siblings, since they are one change in
read:.mp4), open and assigned.So the gap is one set:
MEDIA_MIMESinpackages/core/src/tool/read-filesystem.tsand the magic-byte sniffing inpackages/core/src/mime.tsboth stop at images and PDF, whilemimeToModalityinpackages/core/src/session/model-request.tsalready routesaudio/andvideo/parts. Fixing one without the other leaves the same class of file rejected.