Files
zed/crates
ProhectandCopilot Autofix powered by AI 3afcafe3fc agent: Return clear error when read_file tool path is a directory (#54303)
Fixes #54244

When the `read_file` tool is called with a path that points to a
directory instead of a file, it now returns a clear, actionable error
message telling the agent to use `list_directory` instead.

Previously the tool would fail with an unhelpful generic error. Now it
explicitly checks whether the path is a directory before attempting to
read it.

A test covering this case is also included.

Release Notes:

- Fixed `read_file` tool returning an unhelpful error when given a
directory path; it now suggests using `list_directory` instead.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-06 13:26:09 +00:00
..
2026-05-04 06:30:47 +00:00
2026-04-21 07:25:22 +00:00
2026-04-29 10:27:47 +00:00
2026-04-29 10:27:47 +00:00
2026-05-05 09:35:08 +00:00
2026-05-04 06:30:47 +00:00
2026-04-29 10:27:47 +00:00
2026-04-29 10:27:47 +00:00
…
2026-04-29 10:27:47 +00:00