mirror of
https://github.com/openai/codex.git
synced 2026-11-28 23:34:06 +00:00
Enforce managed model provider selection and definitions (#44650)
## What changed - Support `model_provider` and `model_providers` in managed requirements. Required selection overrides local and session configuration; each required provider definition replaces the corresponding local entry, including its authentication and headers. - Merge provider requirement fragments before validation, preserving source-relative `auth.cwd` paths. Reject invalid cloud provider definitions before replacing the cached bundle, including unsupported Bedrock overrides. - Expose `modelProvider` and `modelProviders` through the configuration requirements API and generated schemas. Reject writes to managed provider settings and omit their local origins, including for provider IDs containing dots. ## Testing Add tests for requirement precedence, authentication fragment merging, path resolution, cloud cache preservation, and read-only configuration RPCs. Integration tests verify that model discovery and inference use the required gateway and ChatGPT authentication without leaking local headers, and that provider requirements survive configuration rebuilds. GitOrigin-RevId: d1448604d4ef5662ebb5df7b693712d3b8ad6d54
This commit is contained in:
1 parent
60825b4988
commit
1aaa453ce2
34 files changed
+998
-41
No files matched your search
@@ -388,6 +388,13 @@ fn map_requirements_toml_to_api(requirements: ConfigRequirementsToml) -> ConfigR
|
||||
.and_then(|windows| windows.sandbox_private_desktop);
|
||||
|
||||
ConfigRequirements {
|
||||
model_provider: requirements.model_provider,
|
||||
model_providers: requirements.model_providers.map(|providers| {
|
||||
providers
|
||||
.into_iter()
|
||||
.map(|(id, provider)| (id, serde_json::json!(provider)))
|
||||
.collect()
|
||||
}),
|
||||
application: requirements.application.map(|application| {
|
||||
codex_app_server_protocol::ApplicationRequirements {
|
||||
network: application.network.map(|network| {
|
||||
|
||||
Reference in new issue
Block a user