zed/crates/agent
Prohect 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
..
src agent: Return clear error when read_file tool path is a directory (#54303) 2026-05-06 13:26:09 +00:00
Cargo.toml agent: Remove old edit file tool (#55612) 2026-05-04 09:54:39 +00:00
LICENSE-GPL