mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
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:
@@ -71,6 +71,7 @@ fn augment_tool_spec_for_code_mode_preserves_exec_tool_description() {
|
||||
augment_tool_spec_for_code_mode(ToolSpec::Freeform(FreeformTool {
|
||||
name: codex_code_mode::PUBLIC_TOOL_NAME.to_string(),
|
||||
description: "Run code".to_string(),
|
||||
defer_loading: None,
|
||||
format: FreeformToolFormat {
|
||||
r#type: "grammar".to_string(),
|
||||
syntax: "lark".to_string(),
|
||||
@@ -80,6 +81,7 @@ fn augment_tool_spec_for_code_mode_preserves_exec_tool_description() {
|
||||
ToolSpec::Freeform(FreeformTool {
|
||||
name: codex_code_mode::PUBLIC_TOOL_NAME.to_string(),
|
||||
description: "Run code".to_string(),
|
||||
defer_loading: None,
|
||||
format: FreeformToolFormat {
|
||||
r#type: "grammar".to_string(),
|
||||
syntax: "lark".to_string(),
|
||||
@@ -94,6 +96,7 @@ fn tool_spec_to_code_mode_tool_definition_returns_augmented_nested_tools() {
|
||||
let spec = ToolSpec::Freeform(FreeformTool {
|
||||
name: "apply_patch".to_string(),
|
||||
description: "Apply a patch".to_string(),
|
||||
defer_loading: None,
|
||||
format: FreeformToolFormat {
|
||||
r#type: "grammar".to_string(),
|
||||
syntax: "lark".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user