mirror of
https://github.com/openai/codex.git
synced 2026-11-05 20:10:33 +00:00
## What changed Allow Responses-compatible providers to configure live web access and remote compaction under `model_providers.<id>.capabilities`: ```toml [model_providers.custom.capabilities] external_web_access = false remote_compaction = "v2" ``` `external_web_access = false` keeps hosted web search from accessing the live web. `remote_compaction` accepts `v2` to send `compaction_trigger` items through the Responses endpoint, or `unsupported` to use local compaction. Omitted capabilities retain existing provider defaults. ## Testing Add unit coverage for preserving unspecified defaults and a request-snapshot scenario verifying cached web search and V2 compaction for a custom provider. GitOrigin-RevId: fbcc4870aa51c112af575d711679a3941d1e7878
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
use super::*;
|
|
use crate::create_model_provider;
|
|
use codex_model_provider_info::ModelProviderCapabilities;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[test]
|
|
fn capability_overrides_preserve_unspecified_provider_defaults() {
|
|
for info in [
|
|
ModelProviderInfo::default(),
|
|
ModelProviderInfo::create_openai_provider(/*base_url*/ None),
|
|
ModelProviderInfo {
|
|
name: "Azure".to_string(),
|
|
..Default::default()
|
|
},
|
|
] {
|
|
let defaults = create_model_provider(info.clone(), /*auth_manager*/ None).capabilities();
|
|
let provider = create_model_provider(
|
|
ModelProviderInfo {
|
|
capabilities: Some(ModelProviderCapabilities {
|
|
external_web_access: Some(false),
|
|
..Default::default()
|
|
}),
|
|
..info
|
|
},
|
|
/*auth_manager*/ None,
|
|
);
|
|
assert_eq!(
|
|
provider.capabilities(),
|
|
ProviderCapabilities {
|
|
external_web_access: false,
|
|
..defaults
|
|
},
|
|
);
|
|
}
|
|
}
|