Support deferred loading for freeform tools (#36856)

## What changed

- Add optional `defer_loading` support to freeform Responses API tool definitions.
- Omit the field when it is unset so existing eager tool definitions retain their wire shape.

## Testing

- Verify legacy freeform tool deserialization and eager and deferred serialization shapes.

GitOrigin-RevId: 50e8658a54ac5b6ae0c1dbfe65f7bb62efef561d
This commit is contained in:
rka-oai
2026-08-04 08:24:42 +00:00
committed by copyberry
parent 5af85998c2
commit 12288240b4
7 changed files with 40 additions and 0 deletions
@@ -30,6 +30,7 @@ SOURCE: /[\s\S]+/
default_exec_yield_time_ms,
code_mode_only,
),
defer_loading: None,
format: FreeformToolFormat {
r#type: "grammar".to_string(),
syntax: "lark".to_string(),
@@ -72,6 +73,7 @@ mod tests {
codex_code_mode::DEFAULT_EXEC_YIELD_TIME_MS,
/*code_mode_only*/ true,
),
defer_loading: None,
format: FreeformToolFormat {
r#type: "grammar".to_string(),
syntax: "lark".to_string(),