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
Text files whose extension Python doesn't know (.go, .tsx, .yaml) are attached as binary, so the model never sees them #1114
MCPFile and prompt-template resources pick text or binary from mimetypes.guess_type. Python's table has no entry for many common source and config files, so guess_mime_type returns application/octet-stream and the file is sent as a base64 blob. The provider converters then replace it with a placeholder, and the model gets no content:
The Anthropic converter gives Embedded Resource file:///…/main.go with unsupported format application/octet-stream (N characters).
On macOS with Python 3.13, mimetypes has no type for .go, .tsx, .jsx, .yaml, .toml, .kt, .swift, .rb, .php, .vue or .ipynb, among others. On Linux the result also depends on whether /etc/mime.types exists, which slim containers often don't have. The same applies to @file mentions of local files in interactive mode, which go through MCPFile, and to resources in prompt templates (load_resource_content).
This is the same symptom as #1025, which fixed it for XML with a charset parameter.
I found this by reading mime_utils.py and checking which extensions mimetypes knows, not while using fast-agent on a project.
A related case I left out of the PR: .ts is registered as video/mp2t (MPEG transport stream), so TypeScript files are sent as video blobs too. Changing that means overriding .ts globally, so that's your call.
Also, on Linux even known types like .rb (application/x-ruby) are treated as binary, because they're not in TEXT_MIME_TYPES.
Activity