Skip to content

[codex] Dedupe plugin MCPs by app declaration name#27607

Merged
xl-openai merged 3 commits into
mainfrom
plugin-auth-routing-app-mcp-name-dedupe
Jun 14, 2026
Merged

[codex] Dedupe plugin MCPs by app declaration name#27607
xl-openai merged 3 commits into
mainfrom
plugin-auth-routing-app-mcp-name-dedupe

Conversation

@felixxia-oai

@felixxia-oai felixxia-oai commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Context

This is the next step in the plugin auth-routing stack. The earlier PRs make PluginsManager auth-aware and move the broad App/MCP surface decision into that layer. This PR narrows the ChatGPT/SIWC behavior so we only hide a plugin MCP server when it conflicts with an App declaration of the same name.

In product terms: if a plugin exposes both an App route and MCP route for foo, ChatGPT/SIWC sessions should use the App route for foo. If the same plugin also exposes a separate MCP server like foo2, that MCP server should remain available.

// .app.json
{
  "apps": {
    "foo": {
      "id": "connector_abc"
    }
  }
}
// .mcp.json
{
  "mcpServers": {
    "foo": {
      "url": "https://mcp.foo.com/mcp"
    },
    "foo2": {
      "url": "https://mcp.foo2.com/mcp"
    }
  }
}

Stack

Summary

  • Preserve App declaration names in loaded plugin metadata.
  • Keep public effective App outputs as deduped connector IDs for existing callers.
  • For ChatGPT/SIWC, suppress only plugin MCP servers whose names match declared App names.

Validation

cargo fmt --all
cargo test -p codex-core-plugins plugin_auth_projection
cargo test -p codex-core-plugins effective_apps
cargo test -p codex-core-plugins read_plugin_for_config_installed_git_source_reads_from_cache_without_cloning
cargo test -p codex-core explicit_plugin_mentions_use_apps_for_chatgpt_dual_surface_plugins
cargo test -p codex-core explicit_plugin_mentions_keep_non_conflicting_mcp_for_chatgpt_auth
cargo test -p codex-app-server --test all plugin_install_filters_disallowed_apps_needing_auth
git diff --check

@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from 74c31a9 to 4c5aac2 Compare June 11, 2026 13:48
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from 02ca35c to e1af8cd Compare June 11, 2026 13:50
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from 4c5aac2 to 1170ba5 Compare June 11, 2026 13:54
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch 3 times, most recently from 37dc34c to 1e22d98 Compare June 11, 2026 14:23
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from 1e22d98 to f93d67f Compare June 11, 2026 15:10
@felixxia-oai

Copy link
Copy Markdown
Contributor 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: f93d67f49d

ℹ️ 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-plugins/src/manager.rs
Comment thread codex-rs/core-plugins/src/loader.rs Outdated
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from f93d67f to 3318660 Compare June 11, 2026 16:11
@felixxia-oai felixxia-oai assigned xl-openai and unassigned xl-openai Jun 11, 2026
@felixxia-oai
felixxia-oai requested a review from xl-openai June 11, 2026 16:34
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 11, 2026 16:40
@felixxia-oai
felixxia-oai requested a review from a team as a code owner June 11, 2026 16:40
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch 4 times, most recently from b3ab11a to 6deaa65 Compare June 11, 2026 18:49
@felixxia-oai felixxia-oai changed the title Dedupe plugin MCPs by app declaration name [codex] Dedupe plugin MCPs by app declaration name Jun 11, 2026
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch 5 times, most recently from c3c298f to f477890 Compare June 11, 2026 19:46
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from 6deaa65 to 621b968 Compare June 11, 2026 19:59
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from f477890 to c3c298f Compare June 11, 2026 20:00
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch 2 times, most recently from 88c8ed1 to 3b03c5a Compare June 11, 2026 20:54
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from 621b968 to e55428e Compare June 11, 2026 21:01
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from 3b03c5a to 763534c Compare June 11, 2026 21:01
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from e55428e to bca8d5d Compare June 11, 2026 21:15
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch 2 times, most recently from b3bb8cf to b3f6795 Compare June 11, 2026 21:34
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 11, 2026 21:39
Comment thread codex-rs/core-plugins/src/loader.rs
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from bca8d5d to 1816572 Compare June 12, 2026 09:44
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from b3f6795 to 531e011 Compare June 12, 2026 09:45
@xl-openai

Copy link
Copy Markdown
Contributor

@codex review again

@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: af36612242

ℹ️ 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-plugins/src/manager.rs
xl-openai added a commit that referenced this pull request Jun 13, 2026
## Context

Plugins can expose more than one way for Codex to use them: App
connectors for ChatGPT/SIWC-backed sessions and MCP servers for API key
login sessions. The broader goal is to make `PluginsManager` the place
that understands which plugin surfaces should be visible for the current
auth route, so callers do not each have to make that decision
themselves.

This PR is the small setup step for that work. It lets the plugin
manager be created with the current `AuthMode`, which gives the followup
auth routing PRs the information they need without relying on setter
injection.

## Stack

- PR1: #27652 seed plugin manager auth at construction.
- PR2: #27459 route plugin surfaces by auth mode.
- PR3: #27607 dedupe plugin MCP servers by App declaration name.
- PR4: #27602 preserve plugin Apps in connector listings.
- PR5: #27461 skip install-time plugin MCP OAuth for matching App
routes.

## Summary

- Let `PluginsManager::new_with_restriction_product` accept an initial
`AuthMode`.
- Keep `PluginsManager::new` behavior unchanged for ordinary callers.

## Validation

```bash
cargo test -p codex-core-plugins plugins_manager_tracks_auth_mode
cargo test -p codex-core list_tool_suggest_discoverable_plugins
git diff --check
```

---------

Co-authored-by: Xin Lin <xl@openai.com>
@xl-openai
xl-openai force-pushed the plugin-auth-routing-route-model branch 2 times, most recently from 8289ca0 to c3f075e Compare June 13, 2026 01:25
xl-openai pushed a commit that referenced this pull request Jun 13, 2026
## Context

Some plugins expose both Apps and MCP servers. This PR moves auth-aware
surface projection into `core-plugins::PluginsManager`, so callers get a
consistent effective plugin view. Later PRs narrow the conflict rule and
update listing/install paths.

The high level goal of this PR is to set up the plumbing to
conditionally filter App/MCP in the plugin manager layer. We start by
removing MCP servers when using SIWC/Codex-backend auth, and removing
Apps when using API-key-style auth.

This PR is now stacked on #27652, which contains only the constructor
plumbing for seeding `PluginsManager` with the current auth mode.

## Stack

- PR1: #27652 seed plugin manager auth at construction.
- PR2: #27459 route plugin surfaces by auth mode.
- PR3: #27607 dedupe plugin MCP servers by App declaration name.
- PR4: #27602 preserve plugin Apps in connector listings.
- PR5: #27461 skip install-time plugin MCP OAuth for matching App
routes.

## Summary

- API-key/non-ChatGPT routes hide plugin Apps and keep plugin MCPs.
- ChatGPT/SIWC with Apps enabled keeps plugin Apps and suppresses MCPs
for dual-surface plugins.
- MCP-only plugins stay available for ChatGPT/SIWC sessions.
- Cached plugin load outcomes are re-projected when auth mode changes.

## Validation

```bash
cargo test -p codex-core-plugins plugin_auth_projection
cargo test -p codex-core list_tool_suggest_discoverable_plugins
git diff --check
```
Base automatically changed from plugin-auth-routing-route-model to main June 13, 2026 02:42
@xl-openai
xl-openai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from af36612 to 48bb4b0 Compare June 13, 2026 03:40
@xl-openai
xl-openai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from 48bb4b0 to f247899 Compare June 13, 2026 23:39
@xl-openai
xl-openai force-pushed the plugin-auth-routing-app-mcp-name-dedupe branch from f247899 to 8235bab Compare June 14, 2026 00:34
@xl-openai
xl-openai merged commit 51316ea into main Jun 14, 2026
31 checks passed
@xl-openai
xl-openai deleted the plugin-auth-routing-app-mcp-name-dedupe branch June 14, 2026 00:53
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 14, 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.

3 participants