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:
pakrym-oai
2026-03-11 09:24:10 -07:00
committed by Michael Bolin
parent 7f22329389
commit 548583198a
4 changed files with 104 additions and 3 deletions

View File

@@ -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#"