Hydrate recommended plugin metadata on selection (#39143)

## What changed

- Fetch recommendations from the Codex-specific `/ps/plugins/suggested/codex` endpoint and parse its compact response shape.
- Fetch the selected plugin's details before presenting an install request, using them to verify availability and populate connector metadata.
- Skip install elicitation when the selected recommendation is no longer available, and return a retryable response when its metadata cannot be verified.

## Testing

- Cover the new recommendation route and response shape.
- Cover metadata hydration for available plugins and rejection of unavailable plugins.

GitOrigin-RevId: 2b0e2d70572aae2b7cd8e458b42e9dd14be3dbaf
This commit is contained in:
Matthew Zeng authored and copyberry committed 2026-08-18 05:42:39 +00:00
1 parent f47f77ada6
commit de7bbb0481
9 files changed
+386 -201

No files matched your search

@@ -55,7 +55,7 @@ async fn recommended_plugins_after_external_login(
let server = responses::start_mock_server().await;
let apps_server = AppsTestServer::mount(&server).await?;
Mock::given(method("GET"))
.and(path("/ps/plugins/suggested"))
.and(path("/ps/plugins/suggested/codex"))
.and(query_param("scope", "GLOBAL"))
.respond_with(
ResponseTemplate::new(200)
@@ -65,9 +65,7 @@ async fn recommended_plugins_after_external_login(
"plugins": [{
"id": "plugin_github",
"name": "github",
"status": "ENABLED",
"installation_policy": "AVAILABLE",
"release": {"display_name": "GitHub"}
"display_name": "GitHub"
}]
})),
)