Thanks for the detailed report.
This is a bug on our side. When a binary file (Word/Excel, and sometimes PDF) is added to chat by typing @ to reference it or dragging it in from the Explorer, we read it as plain text, which mangles the binary bytes (the EF BF BD replacement characters you saw) before it reaches the model. That’s also why the agent falls back to writing a script to read the file.
Workarounds while we fix this:
- PDFs: use the attach button in the chat input to add the PDF instead of
@-referencing it. Attached PDFs are read directly (text is extracted properly). - Word/Excel (.docx/.xlsx): these can’t be attached directly yet, so either save/export the content as
.txt,.md, or.csvand attach or paste that, or convert to PDF and attach it with the button. Letting the agent open the file with a tool (what you’re seeing) does work — it’s just heavier on tokens. - Until then, avoid
@-referencing or dragging raw Office files straight into chat.
I’ve flagged the underlying issue to the team and will update here when there’s progress.