[codex] Cache remote plugin catalog for suggestions (#25457)

## Summary
- cache the global remote plugin catalog when remote plugin listing runs
and warm it during startup
- use the cached remote catalog in plugin install recommendations with
canonical `plugin@openai-curated-remote` ids
- reuse the session `PluginsManager` for plugin recommendations so
remote cache state is visible on the recommend path
- skip core installed-state verification for remote plugin install
suggestions while leaving local plugin and connector verification
unchanged

## Testing
- `just fmt`
- `git diff --check`
- `cargo test -p codex-core
list_tool_suggest_discoverable_plugins_includes_cached_remote_global_plugins`
- `cargo test -p codex-core
remote_plugin_install_suggestions_skip_core_installed_verification`
- `cargo test -p codex-app-server
plugin_list_includes_remote_marketplaces_when_remote_plugin_enabled`

Earlier focused checks during the same branch: codex-tools TUI filter
test, request_plugin_install tests, and codex-app-server build.
This commit is contained in:
xl-openai authored and GitHub committed 2026-06-01 22:10:52 -07:00
1 parent cb63ee7f5d
commit f2b725102b
13 files changed
+771 -62

No files matched your search

@@ -2,6 +2,7 @@ use std::collections::HashSet;
use codex_app_server_protocol::AppInfo;
use codex_config::types::ToolSuggestDisabledTool;
use codex_core_plugins::remote::REMOTE_GLOBAL_MARKETPLACE_NAME;
use codex_mcp::CODEX_APPS_MCP_SERVER_NAME;
use codex_rmcp_client::ElicitationAction;
use codex_rmcp_client::ElicitationResponse;
@@ -273,6 +274,10 @@ async fn verify_request_plugin_install_completed(
verified_connector_install_completed(connector.id.as_str(), &accessible_connectors)
}),
DiscoverableTool::Plugin(plugin) => {
if is_remote_plugin_install_suggestion(&plugin.id) {
return true;
}
session.reload_user_config_layer().await;
let config = session.get_config().await;
let completed = verified_plugin_install_completed(
@@ -293,6 +298,12 @@ async fn verify_request_plugin_install_completed(
}
}
fn is_remote_plugin_install_suggestion(plugin_id: &str) -> bool {
plugin_id
.rsplit_once('@')
.is_some_and(|(_, marketplace_name)| marketplace_name == REMOTE_GLOBAL_MARKETPLACE_NAME)
}
#[expect(
clippy::await_holding_invalid_type,
reason = "connector cache refresh reads through the session-owned manager guard"
@@ -57,6 +57,17 @@ async fn verified_plugin_install_completed_requires_installed_plugin() {
));
}
#[test]
fn remote_plugin_install_suggestions_skip_core_installed_verification() {
assert!(is_remote_plugin_install_suggestion(
"snowflake@openai-curated-remote"
));
assert!(!is_remote_plugin_install_suggestion(
"snowflake@openai-curated"
));
assert!(!is_remote_plugin_install_suggestion("Plugin_123"));
}
#[test]
fn request_plugin_install_response_persists_only_decline_always_mode() {
assert!(request_plugin_install_response_requests_persistent_disable(