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
..
2026-05-06 09:36:43 +00:00
2026-04-24 15:53:14 +00:00
2026-04-27 08:33:40 +00:00
2026-05-06 13:26:09 +00:00
2026-05-06 09:36:43 +00:00
2026-05-05 16:23:03 +00:00
2026-05-06 12:19:33 +00:00
2026-05-05 22:41:13 +00:00
2026-04-27 12:36:11 +00:00
2026-04-23 23:47:30 +00:00
2026-05-05 22:41:13 +00:00
2026-05-01 22:33:54 +00:00
2026-05-05 22:41:13 +00:00
2026-04-23 23:47:30 +00:00
2026-05-05 22:41:13 +00:00
2026-05-01 22:33:54 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 19:08:24 +00:00
2026-04-28 15:44:17 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-04-29 16:29:48 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 06:30:47 +00:00
2026-04-27 08:42:45 +00:00
2026-04-29 10:27:47 +00:00
2026-04-24 10:29:51 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-04-27 13:50:00 +00:00
2026-04-29 10:27:47 +00:00
2026-05-05 22:41:13 +00:00
2026-04-30 11:10:14 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 09:53:36 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 09:53:36 +00:00
2026-05-05 22:41:13 +00:00
2026-05-06 11:57:36 +00:00
2026-05-06 09:28:05 +00:00
2026-05-06 09:35:43 +00:00
2026-04-29 07:27:05 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 09:35:08 +00:00
2026-05-04 06:30:47 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 16:38:14 +00:00
2026-05-06 10:56:20 +00:00
2026-05-05 15:34:56 +00:00
2026-05-05 21:07:52 +00:00
2026-04-30 14:17:32 +00:00
2026-05-06 11:57:36 +00:00
2026-04-27 12:36:11 +00:00
2026-05-06 07:35:40 +00:00
2026-05-06 07:35:40 +00:00
2026-05-06 07:35:40 +00:00
2026-05-04 22:51:56 +00:00
2026-04-24 08:58:26 +00:00
2026-04-23 23:47:30 +00:00
2026-05-04 22:51:56 +00:00
2026-05-06 03:40:02 +00:00
2026-05-06 07:35:40 +00:00
2026-04-24 08:45:47 +00:00
2026-04-29 11:38:03 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-04-29 10:27:47 +00:00
2026-04-24 08:58:26 +00:00
2026-04-29 10:27:47 +00:00
2026-04-27 12:36:11 +00:00
2026-04-27 13:03:33 +00:00
2026-05-06 13:03:00 +00:00
2026-04-24 10:29:51 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 16:44:18 +00:00
2026-05-01 17:29:27 +00:00
2026-04-24 13:54:28 +00:00
2026-04-27 08:47:27 +00:00
2026-05-04 22:51:56 +00:00
2026-04-23 18:41:52 +00:00
2026-05-06 12:27:58 +00:00
2026-05-06 09:28:05 +00:00
2026-04-24 10:29:51 +00:00
2026-05-05 22:41:13 +00:00
2026-04-27 12:36:11 +00:00
2026-05-05 14:30:17 +00:00
2026-05-05 05:10:46 +00:00
2026-05-05 22:41:13 +00:00
2026-04-29 11:38:03 +00:00
2026-05-06 06:57:06 +00:00
2026-05-05 22:41:13 +00:00
2026-04-30 14:11:47 +00:00
2026-05-05 22:41:13 +00:00
2026-04-24 08:58:26 +00:00
2026-05-05 21:44:06 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 16:38:14 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-04 22:51:56 +00:00
2026-05-06 12:19:29 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 16:25:56 +00:00
2026-05-05 22:41:13 +00:00
2026-04-29 10:27:47 +00:00
2026-05-05 22:41:13 +00:00
2026-04-24 10:29:51 +00:00
2026-05-04 06:30:47 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 14:50:57 +00:00
2026-05-05 22:41:13 +00:00
2026-05-06 09:28:05 +00:00
2026-04-23 23:47:30 +00:00
2026-04-23 23:47:30 +00:00
2026-04-23 23:47:30 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 22:41:13 +00:00
2026-05-06 00:06:51 +00:00
2026-05-06 11:57:36 +00:00
2026-05-01 22:33:54 +00:00
2026-05-05 22:41:13 +00:00
2026-05-06 06:57:06 +00:00
2026-05-05 22:41:13 +00:00
2026-05-05 17:10:03 +00:00