mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08: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:
@@ -21,6 +21,7 @@ pub use codex_tools::ToolOutput;
|
||||
pub use codex_tools::ToolPayload;
|
||||
pub use codex_tools::ToolSpec;
|
||||
pub use codex_tools::parse_tool_input_schema;
|
||||
pub use codex_tools::parse_tool_input_schema_without_compaction;
|
||||
pub use contributors::ApprovalReviewContributor;
|
||||
pub use contributors::ConfigContributor;
|
||||
pub use contributors::ContextContributor;
|
||||
|
||||
@@ -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