# Fall back to path-only mention for binary files in the agent panel \(\#61279\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7f96e13d7bbb35a4d0c52a10948009e098986fe8)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7f96e13d7bbb35a4d0c52a10948009e098986fe8

Requested commit: 7f96e13d7bbb35a4d0c52a10948009e098986fe8

Commit: 7f96e13d7bbb35a4d0c52a10948009e098986fe8

Tree: a7eb6c819ce68be82e52512f4c1ec690ef1276fe

Author: serenNan

Committer: GitHub

## Message

```
Fall back to path-only mention for binary files in the agent panel (#61279)

## Summary

- Dragging a binary file (docx, xlsx, pdf, etc.) into the agent panel's
message editor inserted a mention link, then asynchronously tried to
load its content as a text buffer. That failed with "Binary files are
not supported", which surfaced an error toast **and** deleted the
mention text that had already been inserted.
- `confirm_mention_for_file` now catches that specific failure and falls
back to `Mention::Link` (a path-only reference, same as directory
mentions already use), instead of failing the whole mention and
reverting the edit.

## Test plan

- [ ] Drag a `.docx` or `.xlsx` file into the agent panel chat input —
the file path mention should stay inserted with no error toast.
- [ ] Drag a regular text file in — content mention still works as
before (unaffected code path).

Release Notes:

- Fixed dragging a binary file (docx, xlsx, pdf, etc.) into the agent
panel deleting the inserted reference and showing a "Binary files are
not supported" error

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cole Miller <cole@zed.dev>
```

## Parents

- [afd17238ed257d4b7130891e339c534c1a9a828a](https://git.cafe/gitcafe/zed/commit/afd17238ed257d4b7130891e339c534c1a9a828a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7f96e13d7bbb35a4d0c52a10948009e098986fe8?format=markdown)
