mirror of
https://github.com/openai/codex.git
synced 2026-05-18 02:02:30 +00:00
## 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.
19 lines
620 B
Rust
19 lines
620 B
Rust
mod amazon_bedrock;
|
|
mod auth;
|
|
mod bearer_auth_provider;
|
|
mod models_endpoint;
|
|
mod provider;
|
|
|
|
pub use auth::auth_provider_from_auth;
|
|
pub use auth::unauthenticated_auth_provider;
|
|
pub use bearer_auth_provider::BearerAuthProvider;
|
|
pub use bearer_auth_provider::BearerAuthProvider as CoreAuthProvider;
|
|
pub use codex_protocol::account::ProviderAccount;
|
|
pub use provider::ModelProvider;
|
|
pub use provider::ProviderAccountError;
|
|
pub use provider::ProviderAccountResult;
|
|
pub use provider::ProviderAccountState;
|
|
pub use provider::ProviderCapabilities;
|
|
pub use provider::SharedModelProvider;
|
|
pub use provider::create_model_provider;
|