Skip to content

feat: disable capabilities by model provider#19442

Merged
celia-oai merged 5 commits intomainfrom
dev/cc/capabiltiy
Apr 29, 2026
Merged

feat: disable capabilities by model provider#19442
celia-oai merged 5 commits intomainfrom
dev/cc/capabiltiy

Conversation

@celia-oai
Copy link
Copy Markdown
Collaborator

@celia-oai celia-oai commented Apr 24, 2026

Why

Unsupported features must fail closed and Codex must not expose OpenAI-hosted fallback paths when the active provider cannot support them. In practice, Bedrock should not surface app connectors, MCP servers, tool search/suggestions, image generation, web search, or JS REPL until those paths are explicitly supported for that provider.

This PR moves that decision into provider-owned capability metadata instead of scattering Bedrock-specific checks across callers.

What changed

  • Adds ProviderCapabilities to codex-model-provider, with default support for existing providers and a Bedrock override that disables unsupported launch surfaces.
  • Adds ToolCapabilityBounds to codex-tools so provider capability limits can clamp otherwise-enabled tool config.
  • Applies capability bounds when building session and review-thread tool config.
  • Routes MCP/app connector configuration through McpManager::mcp_config, which filters configured MCP servers and app connectors based on the active provider.
  • Updates app-server MCP list/read paths to use the filtered MCP config.
  • Adds coverage for default provider capabilities, Bedrock disabled capabilities, and optional tool-surface clamping.

Testing

built locally and verified that bedrock responses api now return without errors calling unsupported tools.

@celia-oai celia-oai force-pushed the dev/cc/capabiltiy branch 9 times, most recently from 0537b07 to 477ab79 Compare April 24, 2026 22:19
@celia-oai celia-oai changed the title changes feat: a Apply provider capability disables through config layers Apr 24, 2026
@celia-oai celia-oai changed the title feat: a Apply provider capability disables through config layers feat: apply provider capability disables through config layers Apr 24, 2026
@celia-oai celia-oai marked this pull request as ready for review April 24, 2026 23:00
@celia-oai celia-oai requested a review from a team as a code owner April 24, 2026 23:00
@celia-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

Copy link
Copy Markdown
Contributor

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

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: 6adebab0d7

ℹ️ 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/config/provider_capabilities.rs Outdated
Comment thread codex-rs/config/src/merge.rs Outdated
@celia-oai celia-oai marked this pull request as draft April 24, 2026 23:59
@celia-oai
Copy link
Copy Markdown
Collaborator Author

chatted with Pavel offline, this can't live on config level cuz feature flag will be gone. reworking it so core depends on model-provider for toggling features

@celia-oai celia-oai force-pushed the dev/cc/capabiltiy branch 5 times, most recently from 8843ecc to 409335a Compare April 28, 2026 01:02
@celia-oai celia-oai changed the title feat: apply provider capability disables through config layers feat: apply provider capability disables through model provider layer Apr 28, 2026
@celia-oai celia-oai changed the title feat: apply provider capability disables through model provider layer feat: disable capabilities by model provider Apr 28, 2026
@celia-oai celia-oai marked this pull request as ready for review April 28, 2026 16:56
@celia-oai celia-oai removed the request for review from shijie-oai April 28, 2026 17:02
Comment thread codex-rs/core/src/session/mcp.rs Outdated
Comment thread codex-rs/core/src/session/review.rs Outdated
Comment thread codex-rs/tools/src/tool_config.rs Outdated
Comment thread codex-rs/core/src/connectors.rs Outdated
Copy link
Copy Markdown
Collaborator

@pakrym-oai pakrym-oai left a comment

Choose a reason for hiding this comment

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

Are we trying to disable more than we need?

@celia-oai celia-oai force-pushed the dev/cc/capabiltiy branch 3 times, most recently from 2c4e0e0 to b9931f7 Compare April 29, 2026 00:17
@celia-oai celia-oai requested a review from pakrym-oai April 29, 2026 00:40
@celia-oai celia-oai merged commit f8fe96d into main Apr 29, 2026
25 checks passed
@celia-oai celia-oai deleted the dev/cc/capabiltiy branch April 29, 2026 00:51
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 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