mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
fix: dont compact standalone websearch schema (#24660)
add new `parse_tool_input_schema_without_compaction` to bypass the existing compaction/trimming of client-provided tool schemas that are over 4k bytes. we want this for standalone web search to keep field guidance/metadata on certain fields; this keeps us closer to parity with existing hosted tool schema (which didnt go through this 4k byte filter).
This commit is contained in:
1 parent
0d37db4b2b
commit
9fe55d68e6
6 files changed
+53
-10
No files matched your search
@@ -10,7 +10,7 @@ use codex_extension_api::ToolExecutor;
|
||||
use codex_extension_api::ToolName;
|
||||
use codex_extension_api::ToolOutput;
|
||||
use codex_extension_api::ToolSpec;
|
||||
use codex_extension_api::parse_tool_input_schema;
|
||||
use codex_extension_api::parse_tool_input_schema_without_compaction;
|
||||
use codex_login::default_client::build_reqwest_client;
|
||||
use codex_model_provider::SharedModelProvider;
|
||||
use codex_tools::ResponsesApiNamespace;
|
||||
@@ -40,7 +40,8 @@ impl ToolExecutor<ToolCall> for WebSearchTool {
|
||||
}
|
||||
|
||||
fn spec(&self) -> ToolSpec {
|
||||
let parameters = match parse_tool_input_schema(&commands_schema()) {
|
||||
// parse schema without compaction that removes field metadata/descriptions to match hosted tool definition
|
||||
let parameters = match parse_tool_input_schema_without_compaction(&commands_schema()) {
|
||||
Ok(parameters) => parameters,
|
||||
Err(err) => panic!("search command schema should parse: {err}"),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user