Skip to content

Add selected-plugin precedence and attribution to the MCP catalog#27884

Merged
jif-oai merged 5 commits into
mainfrom
jif/selected-plugin-mcp-catalog
Jun 15, 2026
Merged

Add selected-plugin precedence and attribution to the MCP catalog#27884
jif-oai merged 5 commits into
mainfrom
jif/selected-plugin-mcp-catalog

Conversation

@jif-oai

@jif-oai jif-oai commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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:

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.

@jif-oai jif-oai requested a review from a team as a code owner June 12, 2026 14:24
@jif-oai jif-oai changed the title Resolve selected plugin MCP registrations in the catalog Add selected-plugin precedence and attribution to the MCP catalog Jun 12, 2026
@jif-oai

jif-oai commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8489afd8e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/core/src/mcp.rs
Comment thread codex-rs/core/src/mcp.rs
Comment thread codex-rs/codex-mcp/src/catalog.rs
Comment thread codex-rs/core/src/mcp.rs
Comment thread codex-rs/core/src/mcp_tool_call.rs
@jif-oai jif-oai merged commit c3a4796 into main Jun 15, 2026
29 of 31 checks passed
@jif-oai jif-oai deleted the jif/selected-plugin-mcp-catalog branch June 15, 2026 09:10
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants