[wip]tool-api: move extension-facing tool bundles out of codex-tools#22183
[wip]tool-api: move extension-facing tool bundles out of codex-tools#22183jif-oai wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e244b254b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let spec = match bundle.namespace() { | ||
| Some(namespace) => ToolSpec::Namespace(ResponsesApiNamespace { |
There was a problem hiding this comment.
Do not expose namespace specs when disabled
register_tool_bundle always turns a namespaced extension bundle into ToolSpec::Namespace, but this path is called regardless of config.namespace_tools. MCP and dynamic tools explicitly hide namespace specs when that capability is false; extensions will still be sent in model_visible_specs, causing requests to models without namespace-tool support to fail instead of keeping the handler hidden.
Useful? React with 👍 / 👎.
| executor, | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Not sure yet if we need all those accessor but that tends to make my tests cleaner
Why
codex-tool-apiandcodex-toolsstill have different jobs.codex-tool-apiis the small authoring surface that a tool-owning extension crate should depend on. It needs enough to describe and execute an ordinary contributed function tool:ToolBundle,ToolExecutor,ToolCall,ToolError,ToolName,JsonSchema, and namespace metadata.codex-toolsremains host-side. It owns the Responses API wire types and the logic that aggregates built-in tools, MCP tools, dynamic tools, and extension bundles into the model-visible/runtime tool surface. That includes namespace rendering, code-mode augmentation, MCP/dynamic conversion, discovery, and other host-only shaping.Keeping both crates lets us prove the reusable external tool seam without dragging host-only machinery back into extension crates.
What changed
codex-rs/tool-api/codex-toolstypescodex-rs/tools/as the host owner of Responses API tool specs and code-mode/discovery/MCP/dynamic conversion logic, while re-exporting the shared schema types fromcodex-tool-apiToolSpecs directly fromToolBundlemetadata and coalesce namespaced extension bundles into namespace specscodex_extension_apire-exports and tests to use the new surface