Skip to content

[codex] Gate plugin MCP servers by auth route#27459

Merged
xl-openai merged 1 commit into
mainfrom
plugin-auth-routing-route-model
Jun 13, 2026
Merged

[codex] Gate plugin MCP servers by auth route#27459
xl-openai merged 1 commit into
mainfrom
plugin-auth-routing-route-model

Conversation

@felixxia-oai

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

Copy link
Copy Markdown
Contributor

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

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

cargo test -p codex-core-plugins plugin_auth_projection
cargo test -p codex-core list_tool_suggest_discoverable_plugins
git diff --check

@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch 3 times, most recently from 272c710 to e7cd1d0 Compare June 10, 2026 21:54
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 10, 2026 23:03
@felixxia-oai
felixxia-oai requested a review from a team as a code owner June 10, 2026 23:03

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

ℹ️ 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/codex-mcp/src/mcp/mod.rs Outdated
Comment thread codex-rs/codex-mcp/src/mcp/mod.rs Outdated
@felixxia-oai
felixxia-oai marked this pull request as draft June 11, 2026 10:50
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch 2 times, most recently from 879d237 to 74c31a9 Compare June 11, 2026 13:22
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch 2 times, most recently from 4c5aac2 to 1170ba5 Compare June 11, 2026 13:54
@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: 1170ba5097

ℹ️ 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 Outdated
Comment thread codex-rs/core-plugins/src/manager.rs
Comment thread codex-rs/core-plugins/src/manager.rs Outdated
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 11, 2026 16:40
Comment thread codex-rs/core-plugins/src/manager.rs Outdated
Comment thread codex-rs/core-plugins/src/manager.rs Outdated
@felixxia-oai
felixxia-oai marked this pull request as draft June 11, 2026 18:25
@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 base branch from main to plugin-auth-manager-constructor June 11, 2026 18:50
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-manager-constructor branch from 495f1f4 to c9ab74c Compare June 11, 2026 19:59
@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

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: 621b968ad8

ℹ️ 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/manager.rs
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 11, 2026 20:37
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-manager-constructor branch from 6c179f8 to a6b6373 Compare June 11, 2026 21:00
@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-manager-constructor branch from a6b6373 to df88645 Compare June 11, 2026 21:12
@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-manager-constructor branch from df88645 to ba2f04d Compare June 12, 2026 09:38
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-route-model branch from bca8d5d to 1816572 Compare June 12, 2026 09:44
@xl-openai
xl-openai force-pushed the plugin-auth-manager-constructor branch from 490f500 to 57bc034 Compare June 13, 2026 00:28
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>
Base automatically changed from plugin-auth-manager-constructor to main June 13, 2026 01:00
@xl-openai
xl-openai force-pushed the plugin-auth-routing-route-model branch from 1816572 to 8289ca0 Compare June 13, 2026 01:16
@xl-openai
xl-openai force-pushed the plugin-auth-routing-route-model branch from 8289ca0 to c3f075e Compare June 13, 2026 01:25
@xl-openai
xl-openai merged commit 5d7db08 into main Jun 13, 2026
31 checks passed
@xl-openai
xl-openai deleted the plugin-auth-routing-route-model branch June 13, 2026 02:42
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 13, 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