zed/crates
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
..
acp_thread acp: Show running agent version in configuration (#55824) 2026-05-06 09:36:43 +00:00
acp_tools acp: Improve ACP debug view (#54769) 2026-04-24 15:53:14 +00:00
action_log action_log: Fix race condition when committing changes (#53884) 2026-04-16 12:54:17 +00:00
activity_indicator Fix spinner in activity indicator (#54977) 2026-04-27 08:33:40 +00:00
agent agent: Return clear error when read_file tool path is a directory (#54303) 2026-05-06 13:26:09 +00:00
agent_servers acp: Show running agent version in configuration (#55824) 2026-05-06 09:36:43 +00:00
agent_settings Fix agent being able to execute tools that are turned off (#54863) 2026-05-05 16:23:03 +00:00
agent_ui agent_ui: Treat whitespace-only input as empty in MessageEditor (#55530) 2026-05-06 12:19:33 +00:00
ai_onboarding Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
anthropic agent: Allow tools to output multiple content parts (#54518) 2026-04-27 12:36:11 +00:00
askpass Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
assets
audio audio: Remove rodio audio backend (#51945) 2026-03-24 00:58:09 +01:00
auto_update Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
auto_update_helper Fix Windows icon resource for bin zed.exe (#54738) 2026-05-01 22:33:54 +00:00
auto_update_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
aws_http_client
bedrock Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
breadcrumbs editor: Replace BreadcrumbText with HighlightedText (#51083) 2026-03-13 08:00:22 +00:00
buffer_diff action_log: Fix race condition when committing changes (#53884) 2026-04-16 12:54:17 +00:00
call Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
channel Add the ability to reorder favorited collab channels (#52649) 2026-03-30 13:07:13 +00:00
cli Fix Windows icon resource for bin zed.exe (#54738) 2026-05-01 22:33:54 +00:00
client Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
clock
cloud_api_client client: Pass x-zed-system-id header in get_authenticated_user() (#55688) 2026-05-04 19:08:24 +00:00
cloud_api_types collab_ui: Disable Collab panel based on organization configuration (#53567) 2026-04-10 10:15:28 -04:00
cloud_llm_client ep: Fix moving cursor to a predicted position (#55079) 2026-04-28 15:44:17 +00:00
codestral language_model: Decouple from Zed-specific implementation details (#52913) 2026-04-02 17:06:57 -03:00
collab Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
collab_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
collections Add VecMap::entry_ref (#52601) 2026-03-27 18:06:56 -07:00
command_palette Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
command_palette_hooks
component
component_preview Simplify parallel agents onboarding (#53854) 2026-04-15 21:51:15 -03:00
context_server Support latest MCP protocol version (#54494) 2026-04-29 16:29:48 +00:00
copilot Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
copilot_chat Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
copilot_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
crashes Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
credentials_provider language_model: Decouple from Zed-specific implementation details (#52913) 2026-04-02 17:06:57 -03:00
csv_preview Performance tweaks (#54321) 2026-04-21 07:25:22 +00:00
dap dap: Support IPv6 addresses in TCP transport (#52244) 2026-04-27 08:42:45 +00:00
dap_adapters Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
db Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
debug_adapter_extension
debugger_tools Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
debugger_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
deepseek deepseek: Add deepseek-v4-pro & deepseek-v4-flash (#54731) 2026-04-27 13:50:00 +00:00
denoise Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
dev_container Trim nonalphanumeric chars before prefixing image tag name (#54578) 2026-04-23 07:36:36 +00:00
diagnostics Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
docs_preprocessor Staged docs releases (#50136) 2026-04-30 11:10:14 +00:00
edit_prediction Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
edit_prediction_cli ep: Move scores aggegation to edit_prediction_metrics (#55609) 2026-05-04 09:53:36 +00:00
edit_prediction_context Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
edit_prediction_metrics ep: Move scores aggegation to edit_prediction_metrics (#55609) 2026-05-04 09:53:36 +00:00
edit_prediction_types edit_prediction: Disable training data collection based on organization configuration (#53639) 2026-04-10 13:27:04 -04:00
edit_prediction_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
editor editor: Extract rewrap and config out of editor.rs (#55855) 2026-05-06 11:57:36 +00:00
editor_benchmarks editor: Improve find_matches and replace_all perf (#51941) 2026-05-06 09:28:05 +00:00
encoding_selector Require multibuffer excerpts to be ordered and nonoverlapping (#52364) 2026-04-01 17:25:32 +00:00
env_var language_models: Refactor deps and extract cloud (#53270) 2026-04-07 12:28:19 -03:00
etw_tracing
eval_cli eval_cli: Set global filesystem in eval CLI init (#55862) 2026-05-06 09:35:43 +00:00
eval_utils
explorer_command_injector
extension extension_host: Fix Windows manifest paths when uploading extensions to WSL remote (#50653) 2026-04-21 17:32:54 -04:00
extension_api extension_api: Add IPv6 support in DAP extensions API (#54984) 2026-04-29 07:27:05 +00:00
extension_cli extension_host: Fix Windows manifest paths when uploading extensions to WSL remote (#50653) 2026-04-21 17:32:54 -04:00
extension_host Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
extensions_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
feature_flags agent: LSP tools (#55744) 2026-05-05 09:35:08 +00:00
feature_flags_macros Feature flag overrides (#54206) 2026-04-18 06:34:19 +00:00
feedback Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
file_finder Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
file_icons
fs git_graph: Add remote support for search operations (#55167) 2026-05-04 16:38:14 +00:00
fs_benchmarks
fuzzy fuzzy: Fix crash with Unicode chars whose lowercase expands to multiple codepoints (#52989) 2026-04-03 11:00:13 +00:00
fuzzy_nucleo fuzzy_nucleo: Refactor multi-atom code to use nucleo::Pattern (#55264) 2026-05-06 10:56:20 +00:00
git Fix git worktree popup popup no worktree when opened in a project (#55053) 2026-05-05 15:34:56 +00:00
git_graph git_graph: Keep shared parents on the leftmost incoming lane (#55818) 2026-05-05 21:07:52 +00:00
git_hosting_providers Fix GitHub bot avatar URL (#55297) 2026-04-30 14:17:32 +00:00
git_ui editor: Extract rewrap and config out of editor.rs (#55855) 2026-05-06 11:57:36 +00:00
go_to_line Require multibuffer excerpts to be ordered and nonoverlapping (#52364) 2026-04-01 17:25:32 +00:00
google_ai agent: Allow tools to output multiple content parts (#54518) 2026-04-27 12:36:11 +00:00
gpui gpui(windows): Fix unwrap panic when monitor goes missing (#55630) 2026-05-06 07:35:40 +00:00
gpui_linux gpui(windows): Fix unwrap panic when monitor goes missing (#55630) 2026-05-06 07:35:40 +00:00
gpui_macos gpui(windows): Fix unwrap panic when monitor goes missing (#55630) 2026-05-06 07:35:40 +00:00
gpui_macros Handle hiding cursor on keyboard input at GPUI level (#55664) 2026-05-04 22:51:56 +00:00
gpui_platform agent: Fix cargo test -p agent on windows (#52311) 2026-03-24 11:05:12 +00:00
gpui_shared_string gpui_shared_string: Implement SharedString via smol_str (#54649) 2026-04-24 08:58:26 +00:00
gpui_tokio gpui_tokio: Use shutdown_background to avoid WASI panic on exit (#53904) 2026-04-14 18:14:31 +02:00
gpui_util Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
gpui_web Handle hiding cursor on keyboard input at GPUI level (#55664) 2026-05-04 22:51:56 +00:00
gpui_wgpu gpui_linux: Fix Wayland flickering under CPU load by skipping redundant surface commit (#54214) 2026-05-06 03:40:02 +00:00
gpui_windows gpui(windows): Fix unwrap panic when monitor goes missing (#55630) 2026-05-06 07:35:40 +00:00
grammars Highlight nested JSX member expression tags (#53750) 2026-04-24 08:45:47 +00:00
html_to_markdown
http_client http_client: Fix GitHub download unpack failures on some filesystems (#53286) 2026-04-07 11:19:21 +05:30
http_client_tls
icons recent_projects: Add "open in new window" action to opened projects (#55168) 2026-04-29 11:38:03 +00:00
image_viewer gpui: Implement pinch event support for X11 and Windows (#51354) 2026-03-28 18:41:33 -04:00
input_latency_ui telemetry: Add latency metrics (#54454) 2026-04-22 22:22:10 +00:00
inspector_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
install_cli
journal Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
json_schema_store Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
keymap_editor gpui_shared_string: Implement SharedString via smol_str (#54649) 2026-04-24 08:58:26 +00:00
language Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
language_core editor: Fix soft-wrap in auto-height editors (#54051) 2026-04-18 00:55:44 +02:00
language_extension language_core: Introduce fallback highlights (#52575) 2026-04-02 12:52:42 +00:00
language_model agent: Allow tools to output multiple content parts (#54518) 2026-04-27 12:36:11 +00:00
language_model_core Implement tool result conversion for anyhow errors (#55001) 2026-04-27 13:03:33 +00:00
language_models ollama: Fix thinking being also sent as content (#55540) 2026-05-06 13:03:00 +00:00
language_models_cloud Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
language_onboarding Remove some outdated comments (#52432) 2026-03-25 12:07:34 -06:00
language_selector Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
language_tools Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
languages Fix micromamba powershell activation (#55643) 2026-05-04 16:44:18 +00:00
line_ending_selector Require multibuffer excerpts to be ordered and nonoverlapping (#52364) 2026-04-01 17:25:32 +00:00
livekit_api
livekit_client Add ability to auto watch screens (#54839) 2026-05-01 17:29:27 +00:00
lmstudio ai: Add LMStudio API URL & API key support (#48309) 2026-03-06 16:49:55 +00:00
lsp lsp: Display readable gopls version in UI (#49835) 2026-03-17 08:36:37 +01:00
markdown agent_ui: Allow selection of commands from tool calls (#50545) 2026-04-24 13:54:28 +00:00
markdown_preview markdown_preview: Fix Ctrl+S saving checkbox toggle state (#53236) 2026-04-27 08:47:27 +00:00
media
menu
migrator Handle hiding cursor on keyboard input at GPUI level (#55664) 2026-05-04 22:51:56 +00:00
miniprofiler_ui Disable miniprofiler by default (#54645) 2026-04-23 18:41:52 +00:00
mistral Cleanup and update mistral models based on their documentation (#55443) 2026-05-06 12:27:58 +00:00
multi_buffer editor: Improve find_matches and replace_all perf (#51941) 2026-05-06 09:28:05 +00:00
nc
net
node_runtime acp: Use npm --prefix for registry npx agents (#53560) 2026-04-14 11:10:31 +00:00
notifications Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
ollama Prefer Ollama configured model context length over model architecture context length (#53543) 2026-04-15 02:21:56 -04:00
onboarding Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
open_ai agent: Allow tools to output multiple content parts (#54518) 2026-04-27 12:36:11 +00:00
open_path_prompt theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
open_router language_models: Refactor deps and extract cloud (#53270) 2026-04-07 12:28:19 -03:00
opencode opencode: Support interleaved_reasoning and fix DeepSeek (#55574) 2026-05-05 14:30:17 +00:00
outline outline: Fix panic due to stale outline hover selection (#55674) 2026-05-05 05:10:46 +00:00
outline_panel Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
panel ui: Refactor the Button component icon methods (#51496) 2026-03-13 14:13:12 -03:00
paths Fix Node.js language servers failing with --user-data-dir on Windows (#50767) 2026-04-21 07:57:35 +02:00
picker recent_projects: Add "open in new window" action to opened projects (#55168) 2026-04-29 11:38:03 +00:00
platform_title_bar Remove Agent V2 feature flag (#52792) 2026-04-08 00:34:54 +00:00
prettier Fix FormatSelections to only format selected ranges, not entire document (#51593) 2026-03-31 12:48:22 +03:00
project Skip Git tracking for invisible worktrees (#55760) 2026-05-06 06:57:06 +00:00
project_benchmarks Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
project_panel Add git log / history for folders and whole project (#52634) 2026-04-30 14:11:47 +00:00
project_symbols Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
prompt_store gpui_shared_string: Implement SharedString via smol_str (#54649) 2026-04-24 08:58:26 +00:00
proto git_graph: Add remote support (#55788) 2026-05-05 21:44:06 +00:00
recent_projects Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
refineable
release_channel agent: Add ability to import threads from other channels (#54002) 2026-04-15 23:25:44 +00:00
remote Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
remote_connection agent: Fix find_or_create repository to support remote (#54074) 2026-04-16 16:36:09 -07:00
remote_server Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
repl Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
reqwest_client Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
rope Swap arrayvec crate for heapless to use LenT optimization (#47101) 2026-03-21 14:05:30 +01:00
rpc git_graph: Add remote support for search operations (#55167) 2026-05-04 16:38:14 +00:00
rules_library Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
scheduler Remove Executor::close() (#50970) 2026-03-07 04:11:45 +00:00
schema_generator theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
search Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
session Fix shared database test isolation (#51809) 2026-03-18 12:05:57 -07:00
settings Handle hiding cursor on keyboard input at GPUI level (#55664) 2026-05-04 22:51:56 +00:00
settings_content Add OpenCode to provider autocomplete enum (#55586) 2026-05-06 12:19:29 +00:00
settings_json Remove some outdated comments (#52432) 2026-03-25 12:07:34 -06:00
settings_macros
settings_profile_selector Settings profile base option (#52456) 2026-04-02 00:44:53 +00:00
settings_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
shell_command_parser Extract nested command substitutions from arithmetic expansions (#54690) 2026-05-05 16:25:56 +00:00
sidebar Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
snippet
snippet_provider Rust 1.95 (#55104) 2026-04-29 10:27:47 +00:00
snippets_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
sqlez Remove smol as a dependency from a bunch of crates (#53603) 2026-04-24 10:29:51 +00:00
sqlez_macros
streaming_diff
sum_tree Swap arrayvec crate for heapless to use LenT optimization (#47101) 2026-03-21 14:05:30 +01:00
svg_preview gpui: Fix BGRA conversion for SVG rendering (#52641) 2026-03-29 14:43:05 +00:00
syntax_theme Extract syntax_theme crate (#52798) 2026-03-31 08:06:37 -06:00
system_specs Cleanup crashes crate (#54927) 2026-05-04 06:30:47 +00:00
tab_switcher Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
task Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
tasks_ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
telemetry
telemetry_events
terminal Support path pasting in terminal (#48222) 2026-05-05 14:50:57 +00:00
terminal_view Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
text editor: Improve find_matches and replace_all perf (#51941) 2026-05-06 09:28:05 +00:00
theme Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
theme_extension theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
theme_importer theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
theme_selector Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
theme_settings Fix bad GitHub merge queue merge (#54721) 2026-04-23 23:47:30 +00:00
time_format
title_bar Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
toolchain_selector Require multibuffer excerpts to be ordered and nonoverlapping (#52364) 2026-04-01 17:25:32 +00:00
ui Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
ui_input agent_ui: Mask API key input in Add LLM provider modal (#50379) 2026-03-13 19:37:18 -03:00
ui_macros ui: Make UI independent from settings crate (#52578) 2026-03-27 15:31:49 +00:00
ui_prompt theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
util Fix remote worktree path separators (#55486) 2026-05-06 00:06:51 +00:00
util_macros
vim editor: Extract rewrap and config out of editor.rs (#55855) 2026-05-06 11:57:36 +00:00
vim_mode_setting workspace: Only suppress auto-save on focus transfer for the Vim/Helix command palette (#51949) 2026-03-19 12:53:26 -04:00
watch Remove unreferenced dev dependencies (#51093) 2026-03-09 13:22:12 +01:00
web_search
web_search_providers language_models: Refactor deps and extract cloud (#53270) 2026-04-07 12:28:19 -03:00
which_key theme: Split out theme_settings crate (#52569) 2026-03-27 14:41:25 +01:00
windows_resources Fix Windows icon resource for bin zed.exe (#54738) 2026-05-01 22:33:54 +00:00
workspace Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
worktree Skip Git tracking for invisible worktrees (#55760) 2026-05-06 06:57:06 +00:00
worktree_benchmarks
x_ai language_models: Remove unused language model token counting (#54177) 2026-04-22 13:39:48 +00:00
zed Merge gpui::Task and scheduler::Task (#53674) 2026-05-05 22:41:13 +00:00
zed_actions Fix cmd-e on macOS to behave more like it should (#54451) 2026-04-21 19:54:02 +00:00
zed_credentials_provider language_model: Decouple from Zed-specific implementation details (#52913) 2026-04-02 17:06:57 -03:00
zed_env_vars language_model: Decouple from Zed-specific implementation details (#52913) 2026-04-02 17:06:57 -03:00
zeta_prompt ep: Fix V0420 Diagnostics format (#55798) 2026-05-05 17:10:03 +00:00
zlog
zlog_settings
ztracing
ztracing_macro