Delegate installed plugin recommendation filtering to the endpoint (#61374)

## What changed

Request plugin suggestions with `includeInstalled=false` and use the endpoint results without filtering against loaded plugins or the local installed-plugin cache. Retain disabled-tool and client eligibility filtering, and remove plugin loading that was only needed for recommendation filtering.

## Testing

Update tests to verify the query parameter and confirm that endpoint recommendations survive local installed-cache filtering while disabled tools remain excluded.

GitOrigin-RevId: a1b199f9ac8da7dae40abe46b6ccfaf1d8230a5c
This commit is contained in:
Alex Zamoshchin
2026-11-13 21:00:04 +00:00
committed by copyberry
parent 7194b21776
commit a46c5be77e
7 changed files with 12 additions and 64 deletions
-7
View File
@@ -5134,12 +5134,6 @@ impl Session {
developer_sections
.push(DeveloperInstructions::new(developer_instructions).render_fragment());
}
let loaded_plugins = self
.services
.plugins_manager
.plugins_for_config(&turn_context.config.plugins_config_input())
.await
.without_plugins(&turn_context.disabled_plugin_ids);
let recommended_plugin_candidates = if turn_context
.config
.features
@@ -5151,7 +5145,6 @@ impl Session {
.plugins_manager
.recommended_plugin_candidates_for_config(RecommendedPluginCandidatesInput {
plugins_config: &plugins_config,
loaded_plugins: &loaded_plugins,
auth: auth.as_ref(),
disabled_tools: &turn_context.config.tool_suggest.disabled_tools,
app_server_client_name: turn_context.app_server_client_name.as_deref(),
-7
View File
@@ -2105,12 +2105,6 @@ pub(crate) async fn prepare_tool_recommendations(
sess: &Session,
turn_context: &TurnContext,
) -> PreparedToolRecommendations {
let loaded_plugins = sess
.services
.plugins_manager
.plugins_for_config(&turn_context.config.plugins_config_input())
.await
.without_plugins(&turn_context.disabled_plugin_ids);
let tool_suggest_is_enabled = tool_suggest_enabled(turn_context);
let auth = if tool_suggest_is_enabled {
sess.services.auth_manager.auth().await
@@ -2123,7 +2117,6 @@ pub(crate) async fn prepare_tool_recommendations(
.plugins_manager
.recommended_plugin_candidates_for_config(RecommendedPluginCandidatesInput {
plugins_config: &plugins_config,
loaded_plugins: &loaded_plugins,
auth: auth.as_ref(),
disabled_tools: &turn_context.config.tool_suggest.disabled_tools,
app_server_client_name: turn_context.app_server_client_name.as_deref(),