Skip to content

[codex] Centralize plugin auth capability filtering#27902

Merged
felixxia-oai merged 3 commits into
mainfrom
plugin-auth-capability-resolver
Jun 16, 2026
Merged

[codex] Centralize plugin auth capability filtering#27902
felixxia-oai merged 3 commits into
mainfrom
plugin-auth-capability-resolver

Conversation

@felixxia-oai

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

Copy link
Copy Markdown
Contributor

Summary

This is the first step in making plugin auth routing consistent. The rule should not live as one-off checks in every place that loads or displays plugin capabilities.

This PR introduces a small resolver for the auth-level policy: given a plugin's declared apps, MCP servers, current auth mode, and active state, return the capabilities that are actually usable in that context.

Why

Product rule:

  • SiWC auth can use app connectors, so app declarations stay available.
  • API-key/direct auth cannot use app connectors, so app declarations are removed.
  • When an active plugin has both an app and an MCP server with the same name, the app route wins for Codex-backed auth and the conflicting MCP server is hidden.

Putting that rule in capabilities.rs gives the rest of the stack one place to ask instead of duplicating auth checks in loader, manager, marketplace, and details code.

Validation

  • cargo fmt
  • cargo test -p codex-core-plugins

@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: 66f75a8dbd

ℹ️ 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/capabilities.rs Outdated
@felixxia-oai
felixxia-oai marked this pull request as ready for review June 12, 2026 21:43
@felixxia-oai
felixxia-oai requested a review from xl-openai June 12, 2026 21:43
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-capability-resolver branch from 66f75a8 to 3b3cc6f Compare June 12, 2026 21:53

Copy link
Copy Markdown
Contributor

I think this may be more than we need right now. The existing logic is small and only appears in two different flows, so I’d prefer to keep it local for now rather than introduce a shared resolver.

@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from e965da8 to 0ce28ac Compare June 15, 2026 11:08
@felixxia-oai
felixxia-oai requested a review from a team as a code owner June 15, 2026 11:08
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-capability-resolver branch from 3b3cc6f to e5317f3 Compare June 15, 2026 11:52
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-routing-tool-exposure branch from a307818 to 3c9aaf3 Compare June 15, 2026 12:52
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-capability-resolver branch from e5317f3 to 1b4b4f1 Compare June 15, 2026 12:52
Base automatically changed from plugin-auth-routing-tool-exposure to main June 15, 2026 13:04
@felixxia-oai
felixxia-oai force-pushed the plugin-auth-capability-resolver branch from 1b4b4f1 to 867e7df Compare June 15, 2026 13:07
@felixxia-oai

felixxia-oai commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

I think this may be more than we need right now. The existing logic is small and only appears in two different flows, so I’d prefer to keep it local for now rather than introduce a shared resolver.

I wanted this to be a layer where the routing logic lives. I'd like the end state to be if we wanted to change the filtering/routing logic in the future, we'd only need to change it in one place.

After the next PR in this stack #27958, this logic is used in 3 places so I think it'd be good to extract.

@felixxia-oai
felixxia-oai enabled auto-merge (squash) June 15, 2026 19:00
Comment thread codex-rs/core-plugins/src/capabilities.rs Outdated
@felixxia-oai
felixxia-oai merged commit 7e0dce9 into main Jun 16, 2026
31 checks passed
@felixxia-oai
felixxia-oai deleted the plugin-auth-capability-resolver branch June 16, 2026 00:13
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 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