From bf7148626b36e278e8473a09996f21ec6a0c7482 Mon Sep 17 00:00:00 2001 From: Eric Ning Date: Mon, 22 Jun 2026 15:08:59 -0700 Subject: [PATCH] [codex] fetch featured IDs for remote plugins (#29485) ## Summary - fetch featured plugin IDs when the loaded catalog includes `openai-curated-remote` - extend the existing remote marketplace regression test to cover the featured IDs response ## Why When the remote plugin catalog was enabled, app-server loaded `openai-curated-remote` but skipped `/plugins/featured` because the request processor only fetched featured IDs for the local `openai-curated` marketplace. As a result, the desktop app could not render the backend-curated remote featured set. This keeps the existing local behavior and also returns the curated ranking for remote plugins. ## Test plan - `just fmt` - `git diff --check` - `just test -p codex-app-server plugin_list_includes_remote_marketplaces_when_remote_plugin_enabled` --- .../app-server/src/request_processors/plugins.rs | 9 ++++----- codex-rs/app-server/tests/suite/v2/plugin_list.rs | 13 ++++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/codex-rs/app-server/src/request_processors/plugins.rs b/codex-rs/app-server/src/request_processors/plugins.rs index 1e4716a88..3913ded3a 100644 --- a/codex-rs/app-server/src/request_processors/plugins.rs +++ b/codex-rs/app-server/src/request_processors/plugins.rs @@ -745,11 +745,10 @@ impl PluginRequestProcessor { ); } - let featured_plugin_ids = if !plugins_input.remote_plugin_enabled - && data - .iter() - .any(|marketplace| marketplace.name == OPENAI_CURATED_MARKETPLACE_NAME) - { + let featured_plugin_ids = if data.iter().any(|marketplace| { + marketplace.name == OPENAI_CURATED_MARKETPLACE_NAME + || marketplace.name == REMOTE_GLOBAL_MARKETPLACE_NAME + }) { match plugins_manager .featured_plugin_ids_for_config(&plugins_input, auth.as_ref()) .await diff --git a/codex-rs/app-server/tests/suite/v2/plugin_list.rs b/codex-rs/app-server/tests/suite/v2/plugin_list.rs index 62a17278f..bcfd85f19 100644 --- a/codex-rs/app-server/tests/suite/v2/plugin_list.rs +++ b/codex-rs/app-server/tests/suite/v2/plugin_list.rs @@ -1761,6 +1761,14 @@ async fn plugin_list_includes_remote_marketplaces_when_remote_plugin_enabled() - .respond_with(ResponseTemplate::new(200).set_body_string(empty_page_body)) .mount(&server) .await; + Mock::given(method("GET")) + .and(path("/backend-api/plugins/featured")) + .and(query_param("platform", "codex")) + .respond_with( + ResponseTemplate::new(200).set_body_string(r#"["linear@openai-curated-remote"]"#), + ) + .mount(&server) + .await; let mut mcp = TestAppServer::new(codex_home.path()).await?; timeout(DEFAULT_TIMEOUT, mcp.initialize()).await??; @@ -1854,7 +1862,10 @@ async fn plugin_list_includes_remote_marketplaces_when_remote_plugin_enabled() - cached_plugin_ids, vec!["plugins~Plugin_00000000000000000000000000000000".to_string()] ); - assert_eq!(response.featured_plugin_ids, Vec::::new()); + assert_eq!( + response.featured_plugin_ids, + vec!["linear@openai-curated-remote".to_string()] + ); assert!( !server .received_requests()