mirror of
https://github.com/openai/codex.git
synced 2026-04-26 07:35:29 +00:00
Extract built-in tool spec constructors into codex-tools (#16493)
## Why `core/src/tools/spec.rs` still had a few built-in tool specs assembled inline even though those definitions are pure metadata and already live conceptually in `codex-tools`. Keeping that construction in `codex-core` makes `spec.rs` do more than registry orchestration and slows the migration toward a right-sized `codex-tools` crate. This continues the extraction stack from #16379, #16471, #16477, #16481, and #16482. ## What Changed - added `create_local_shell_tool()`, `create_web_search_tool(...)`, and `create_image_generation_tool(...)` to `codex-rs/tools/src/tool_spec.rs` - exported those helpers from `codex-rs/tools/src/lib.rs` - switched `codex-rs/core/src/tools/spec.rs` to call those helpers instead of constructing `ToolSpec::LocalShell`, `ToolSpec::WebSearch`, and `ToolSpec::ImageGeneration` inline - removed the remaining core-local web-search content-type constant and made the affected spec test assert the literal expected values directly This is intended to be a straight refactor: tool behavior and wire shape should not change. ## Testing - `cargo test -p codex-tools` - `cargo test -p codex-core tools::spec::tests`
This commit is contained in:
@@ -102,7 +102,11 @@ pub use tool_spec::ConfiguredToolSpec;
|
||||
pub use tool_spec::ResponsesApiWebSearchFilters;
|
||||
pub use tool_spec::ResponsesApiWebSearchUserLocation;
|
||||
pub use tool_spec::ToolSpec;
|
||||
pub use tool_spec::WebSearchToolOptions;
|
||||
pub use tool_spec::create_image_generation_tool;
|
||||
pub use tool_spec::create_local_shell_tool;
|
||||
pub use tool_spec::create_tools_json_for_responses_api;
|
||||
pub use tool_spec::create_web_search_tool;
|
||||
pub use utility_tool::create_list_dir_tool;
|
||||
pub use utility_tool::create_test_sync_tool;
|
||||
pub use view_image::ViewImageToolOptions;
|
||||
|
||||
Reference in New Issue
Block a user