mirror of
https://github.com/openai/codex.git
synced 2026-04-30 09:26:44 +00:00
Allow bool web_search in ToolsToml (#14352)
Summary - add a custom deserializer so `[tools].web_search` can be a bool (treated as disabled) or a config object - extend core and app-server tests to cover bool handling in TOML config Testing - Not run (not requested)
This commit is contained in:
committed by
Michael Bolin
parent
7f22329389
commit
548583198a
@@ -175,6 +175,44 @@ enabled = false
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tools_web_search_true_deserializes_to_none() {
|
||||
let cfg: ConfigToml = toml::from_str(
|
||||
r#"
|
||||
[tools]
|
||||
web_search = true
|
||||
"#,
|
||||
)
|
||||
.expect("TOML deserialization should succeed");
|
||||
|
||||
assert_eq!(
|
||||
cfg.tools,
|
||||
Some(ToolsToml {
|
||||
web_search: None,
|
||||
view_image: None,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tools_web_search_false_deserializes_to_none() {
|
||||
let cfg: ConfigToml = toml::from_str(
|
||||
r#"
|
||||
[tools]
|
||||
web_search = false
|
||||
"#,
|
||||
)
|
||||
.expect("TOML deserialization should succeed");
|
||||
|
||||
assert_eq!(
|
||||
cfg.tools,
|
||||
Some(ToolsToml {
|
||||
web_search: None,
|
||||
view_image: None,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_toml_deserializes_model_availability_nux() {
|
||||
let toml = r#"
|
||||
|
||||
Reference in New Issue
Block a user