mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
c3a479620f
## Why **In short:** this PR resolves already-discovered MCP registrations. It does not read selected plugins or discover their MCP servers. The resolved MCP catalog currently builds config and auto-discovered plugin registrations before runtime contributors are applied. A thread-selected plugin needs a distinct precedence tier in that same initial resolution pass: otherwise a disabled lower-precedence winner can leave stale name-level state behind, and the winning MCP tools cannot be attributed to the selected package reliably. This PR adds that catalog boundary before executor discovery is connected. ## What changed - Added an explicit selected-plugin registration tier between auto-discovered plugins and explicit config. - Collected selected-plugin contributions before the initial catalog build, while leaving compatibility and generic extension overlays in their existing runtime phase. - Retained the winning plugin ID and display name directly on plugin-owned catalog registrations. - Derived MCP tool provenance from the winning catalog entry instead of joining against local-only plugin summaries. - Retained the winning selected server's tool approval policy in the running connection manager, so a selected registration cannot inherit approval behavior from a losing local plugin. - Kept remembered approval session-scoped for selected plugins until there is an authority-aware persistence contract; Codex will not write approval back to an unrelated local plugin. - Preserved existing name-level disabled vetoes for discovered plugins and config, while keeping a selected package's own disabled registration scoped to that registration. - Preserved deterministic selection order and existing config, compatibility, and extension precedence. The resulting order is: ```text auto-discovered plugin < selected plugin < explicit config < compatibility registration < extension overlay ``` ## Behavior and scope This is a catalog and provenance change only. No production host contributes selected-plugin MCP registrations yet, so existing local MCP behavior remains unchanged. The stacked follow-up, #27870, installs the executor plugin provider that produces these registrations. App-server activation remains a separate final step. ## Verification Focused tests cover precedence, deterministic selected-plugin conflicts, disabled-veto behavior across catalog phases, managed requirements before selected-plugin resolution, winning-server approval policy, and attribution when local and selected packages share an ID or server name. CI owns execution of the test suite.
84 lines
3.0 KiB
Rust
84 lines
3.0 KiB
Rust
pub use connection_manager::McpConnectionManager;
|
|
pub use connection_manager::tool_is_model_visible;
|
|
pub use elicitation::ElicitationReviewRequest;
|
|
pub use elicitation::ElicitationReviewer;
|
|
pub use elicitation::ElicitationReviewerHandle;
|
|
pub use resource_client::McpResourceClient;
|
|
pub use resource_client::McpResourcePage;
|
|
pub use resource_client::McpResourceReadResult;
|
|
pub use rmcp_client::MCP_SANDBOX_STATE_META_CAPABILITY;
|
|
pub use runtime::McpRuntimeContext;
|
|
pub use runtime::SandboxState;
|
|
pub use tools::ToolInfo;
|
|
|
|
pub use catalog::McpCatalogBuilder;
|
|
pub use catalog::McpPluginAttribution;
|
|
pub use catalog::McpServerConflict;
|
|
pub use catalog::McpServerConflictAction;
|
|
pub use catalog::McpServerRegistration;
|
|
pub use catalog::McpServerSource;
|
|
pub use catalog::ResolvedMcpCatalog;
|
|
pub use catalog::ResolvedMcpServer;
|
|
|
|
pub use mcp::CODEX_APPS_MCP_SERVER_NAME;
|
|
pub use mcp::McpConfig;
|
|
pub use mcp::ToolPluginProvenance;
|
|
pub use server::EffectiveMcpServer;
|
|
|
|
pub use auth_elicitation::CodexAppsAuthElicitation;
|
|
pub use auth_elicitation::CodexAppsAuthElicitationPlan;
|
|
pub use auth_elicitation::CodexAppsConnectorAuthFailure;
|
|
pub use auth_elicitation::MCP_TOOL_CODEX_APPS_META_KEY;
|
|
pub use auth_elicitation::auth_elicitation_completed_result;
|
|
pub use auth_elicitation::auth_elicitation_id;
|
|
pub use auth_elicitation::build_auth_elicitation;
|
|
pub use auth_elicitation::build_auth_elicitation_plan;
|
|
pub use auth_elicitation::connector_auth_failure_from_tool_result;
|
|
pub use codex_apps::CodexAppsToolsCacheKey;
|
|
pub use codex_apps::codex_apps_tools_cache_key;
|
|
pub use mcp::codex_apps_mcp_server_config;
|
|
pub use mcp::configured_mcp_servers;
|
|
pub use mcp::effective_mcp_servers;
|
|
pub use mcp::effective_mcp_servers_from_configured;
|
|
pub use mcp::host_owned_codex_apps_enabled;
|
|
pub use mcp::hosted_plugin_runtime_mcp_server_config;
|
|
pub use mcp::tool_plugin_provenance;
|
|
pub use plugin_config::PluginMcpConfigParseOutcome;
|
|
pub use plugin_config::PluginMcpServerParseError;
|
|
pub use plugin_config::PluginMcpServerPlacement;
|
|
pub use plugin_config::parse_plugin_mcp_config;
|
|
|
|
pub use mcp::McpServerStatusSnapshot;
|
|
pub use mcp::McpSnapshotDetail;
|
|
pub use mcp::collect_mcp_server_status_snapshot_with_detail;
|
|
pub use mcp::read_mcp_resource;
|
|
|
|
pub use mcp::McpAuthStatusEntry;
|
|
pub use mcp::McpOAuthLoginConfig;
|
|
pub use mcp::McpOAuthLoginSupport;
|
|
pub use mcp::McpOAuthScopesSource;
|
|
pub use mcp::ResolvedMcpOAuthScopes;
|
|
pub use mcp::compute_auth_statuses;
|
|
pub use mcp::discover_supported_scopes;
|
|
pub use mcp::oauth_login_support;
|
|
pub use mcp::resolve_oauth_scopes;
|
|
pub use mcp::should_retry_without_scopes;
|
|
|
|
pub use mcp::McpPermissionPromptAutoApproveContext;
|
|
pub use mcp::mcp_permission_prompt_is_auto_approved;
|
|
pub use mcp::qualified_mcp_tool_name_prefix;
|
|
pub use tools::declared_openai_file_input_param_names;
|
|
|
|
pub(crate) mod auth_elicitation;
|
|
mod catalog;
|
|
pub(crate) mod codex_apps;
|
|
pub(crate) mod connection_manager;
|
|
pub(crate) mod elicitation;
|
|
pub(crate) mod mcp;
|
|
mod plugin_config;
|
|
mod resource_client;
|
|
pub(crate) mod rmcp_client;
|
|
pub(crate) mod runtime;
|
|
pub(crate) mod server;
|
|
pub(crate) mod tools;
|