fix: stabilize watchdog self-close tests

This commit is contained in:
Friel
2026-04-01 03:01:03 +00:00
parent 380060ab8d
commit f03478f38d
2 changed files with 185 additions and 0 deletions
+27
View File
@@ -9,6 +9,7 @@ use crate::JsonSchema;
use crate::ResponsesApiNamespace;
use crate::ResponsesApiTool;
use crate::create_tools_json_for_responses_api;
use crate::create_watchdog_self_close_tool;
use codex_protocol::config_types::WebSearchContextSize;
use codex_protocol::config_types::WebSearchFilters as ConfigWebSearchFilters;
use codex_protocol::config_types::WebSearchUserLocation as ConfigWebSearchUserLocation;
@@ -114,6 +115,32 @@ fn configured_tool_spec_name_delegates_to_tool_spec() {
);
}
#[test]
fn watchdog_self_close_tool_spec_is_deferred_and_parameterless() {
let ToolSpec::Function(ResponsesApiTool {
name,
defer_loading,
parameters,
output_schema,
..
}) = create_watchdog_self_close_tool()
else {
panic!("watchdog_self_close should be a function tool");
};
assert_eq!(name, "watchdog_self_close");
assert_eq!(defer_loading, Some(true));
assert_eq!(
parameters,
JsonSchema::Object {
properties: BTreeMap::new(),
required: None,
additional_properties: Some(AdditionalProperties::Boolean(false)),
}
);
assert!(output_schema.is_some());
}
#[test]
fn web_search_config_converts_to_responses_api_types() {
assert_eq!(