agent: Don't offer feature-flag-gated tools in agent profiles - #58581
Merged
yara-blue merged 5 commits intoJun 8, 2026
Merged
Conversation
The agent-profile tool picker listed every built-in tool from `ALL_TOOL_NAMES`, filtering only by provider support. But `Thread::enabled_tools` additionally drops feature-flag-gated tools (the LSP tools, `rename_symbol`, `create_thread`, `update_plan`, `update_title`) unless their flag is active. Users could enable those tools in a profile, yet the agent never received them. Extract the flag gating into a single shared predicate, `tool_feature_flag_enabled`, and route both `enabled_tools` and the profile tool picker through it, so the configuration UI can never offer a tool the agent would silently drop. Fixes zed-industries#56778 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rabbiveesh
marked this pull request as ready for review
June 4, 2026 19:42
Contributor
Author
|
Note to maintainers - if you'd prefer the canonical list of feature flags to live elsewhere, i can move them; this seems good to me in a vaccum but you have more context |
yara-blue
suggested changes
Jun 5, 2026
yara-blue
left a comment
Contributor
There was a problem hiding this comment.
One note otherwise good, thanks!
yara-blue
enabled auto-merge
June 5, 2026 11:01
yara-blue
approved these changes
Jun 5, 2026
yara-blue
disabled auto-merge
June 5, 2026 12:45
Contributor
|
Super minor test failure. Could you fix that? |
Contributor
Author
|
Ya gladly; 😀 |
yara-blue
enabled auto-merge
June 8, 2026 09:09
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 8, 2026
…dustries#58581) Closes zed-industries#56778 ## Problem The agent-profile tool configuration lists every built-in tool from `agent::ALL_TOOL_NAMES`, filtering only by provider support (`crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs`). But `Thread::enabled_tools` additionally drops feature-flag-gated tools before they reach the model — the LSP tools (`go_to_definition`, `find_references`, `get_code_actions`, `apply_code_action`) behind `LspToolFeatureFlag`, `rename_symbol` behind `RenameToolFeatureFlag`, and `create_thread` / `list_agents_and_models` / `update_plan` / `update_title` behind their own flags. The result: when a flag is off, a user can enable the tool in a profile, but the agent never receives it. The picker and the runtime gate disagreed. ## Fix Extract the feature-flag gating into a single shared predicate, `agent::tool_feature_flag_enabled`, and route **both** `Thread::enabled_tools` and the profile tool picker through it. The configuration UI can no longer offer a tool the agent would silently drop, and the two call sites can't drift apart. Also updated the "silent drop gates" comment in `tools.rs` to document this third gate. This matches the behavior requested in the issue (don't list tools that can't be used). The alternative — showing them disabled with an explanation — is also possible; happy to switch if preferred. ## Testing - Added `lsp_tools_are_gated_by_their_feature_flag` in `crates/agent/src/tools.rs`. - `cargo test -p agent`, `cargo clippy -p agent`, and `cargo fmt` are clean. - (`agent_ui` doesn't build in my local environment due to an unrelated `webrtc-sys` C++ toolchain issue; the `agent_ui` change is a one-line filter addition mirroring the adjacent provider-support check — relying on CI to confirm.) Release Notes: - Fixed feature-flag-gated tools (such as the LSP tools) being listed in agent profile configuration when they could not actually be used by the agent. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…dustries#58581) Closes zed-industries#56778 ## Problem The agent-profile tool configuration lists every built-in tool from `agent::ALL_TOOL_NAMES`, filtering only by provider support (`crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs`). But `Thread::enabled_tools` additionally drops feature-flag-gated tools before they reach the model — the LSP tools (`go_to_definition`, `find_references`, `get_code_actions`, `apply_code_action`) behind `LspToolFeatureFlag`, `rename_symbol` behind `RenameToolFeatureFlag`, and `create_thread` / `list_agents_and_models` / `update_plan` / `update_title` behind their own flags. The result: when a flag is off, a user can enable the tool in a profile, but the agent never receives it. The picker and the runtime gate disagreed. ## Fix Extract the feature-flag gating into a single shared predicate, `agent::tool_feature_flag_enabled`, and route **both** `Thread::enabled_tools` and the profile tool picker through it. The configuration UI can no longer offer a tool the agent would silently drop, and the two call sites can't drift apart. Also updated the "silent drop gates" comment in `tools.rs` to document this third gate. This matches the behavior requested in the issue (don't list tools that can't be used). The alternative — showing them disabled with an explanation — is also possible; happy to switch if preferred. ## Testing - Added `lsp_tools_are_gated_by_their_feature_flag` in `crates/agent/src/tools.rs`. - `cargo test -p agent`, `cargo clippy -p agent`, and `cargo fmt` are clean. - (`agent_ui` doesn't build in my local environment due to an unrelated `webrtc-sys` C++ toolchain issue; the `agent_ui` change is a one-line filter addition mirroring the adjacent provider-support check — relying on CI to confirm.) Release Notes: - Fixed feature-flag-gated tools (such as the LSP tools) being listed in agent profile configuration when they could not actually be used by the agent. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…dustries#58581) Closes zed-industries#56778 ## Problem The agent-profile tool configuration lists every built-in tool from `agent::ALL_TOOL_NAMES`, filtering only by provider support (`crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs`). But `Thread::enabled_tools` additionally drops feature-flag-gated tools before they reach the model — the LSP tools (`go_to_definition`, `find_references`, `get_code_actions`, `apply_code_action`) behind `LspToolFeatureFlag`, `rename_symbol` behind `RenameToolFeatureFlag`, and `create_thread` / `list_agents_and_models` / `update_plan` / `update_title` behind their own flags. The result: when a flag is off, a user can enable the tool in a profile, but the agent never receives it. The picker and the runtime gate disagreed. ## Fix Extract the feature-flag gating into a single shared predicate, `agent::tool_feature_flag_enabled`, and route **both** `Thread::enabled_tools` and the profile tool picker through it. The configuration UI can no longer offer a tool the agent would silently drop, and the two call sites can't drift apart. Also updated the "silent drop gates" comment in `tools.rs` to document this third gate. This matches the behavior requested in the issue (don't list tools that can't be used). The alternative — showing them disabled with an explanation — is also possible; happy to switch if preferred. ## Testing - Added `lsp_tools_are_gated_by_their_feature_flag` in `crates/agent/src/tools.rs`. - `cargo test -p agent`, `cargo clippy -p agent`, and `cargo fmt` are clean. - (`agent_ui` doesn't build in my local environment due to an unrelated `webrtc-sys` C++ toolchain issue; the `agent_ui` change is a one-line filter addition mirroring the adjacent provider-support check — relying on CI to confirm.) Release Notes: - Fixed feature-flag-gated tools (such as the LSP tools) being listed in agent profile configuration when they could not actually be used by the agent. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #56778
Problem
The agent-profile tool configuration lists every built-in tool from
agent::ALL_TOOL_NAMES, filtering only by provider support (crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs). ButThread::enabled_toolsadditionally drops feature-flag-gated tools before they reach the model — the LSP tools (go_to_definition,find_references,get_code_actions,apply_code_action) behindLspToolFeatureFlag,rename_symbolbehindRenameToolFeatureFlag, andcreate_thread/list_agents_and_models/update_plan/update_titlebehind their own flags.The result: when a flag is off, a user can enable the tool in a profile, but the agent never receives it. The picker and the runtime gate disagreed.
Fix
Extract the feature-flag gating into a single shared predicate,
agent::tool_feature_flag_enabled, and route bothThread::enabled_toolsand the profile tool picker through it. The configuration UI can no longer offer a tool the agent would silently drop, and the two call sites can't drift apart. Also updated the "silent drop gates" comment intools.rsto document this third gate.This matches the behavior requested in the issue (don't list tools that can't be used). The alternative — showing them disabled with an explanation — is also possible; happy to switch if preferred.
Testing
lsp_tools_are_gated_by_their_feature_flagincrates/agent/src/tools.rs.cargo test -p agent,cargo clippy -p agent, andcargo fmtare clean.agent_uidoesn't build in my local environment due to an unrelatedwebrtc-sysC++ toolchain issue; theagent_uichange is a one-line filter addition mirroring the adjacent provider-support check — relying on CI to confirm.)Release Notes: