Move tool search metadata onto ToolExecutor#25684
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c68a3b5688
ℹ️ 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".
| ToolSpec::Function(mut tool) => { | ||
| tool.defer_loading = Some(true); | ||
| tool.output_schema = None; | ||
| LoadableToolSpec::Function(tool) |
There was a problem hiding this comment.
Preserve namespaces for default deferred function specs
For deferred extension executors whose tool_name() is namespaced but whose spec() is a single ToolSpec::Function, the default metadata path returns that function as a top-level loadable tool. After tool_search exposes it, the model will call the plain function name, but the registry registered the executor under the namespaced ToolName, so dispatch cannot find the tool. Either wrap function specs in the executor's namespace here or decline the default when tool_name.namespace and the spec shape do not match.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
those functions can't exist
Deferred tools need to be searchable even when they are not implemented inside
codex-core. Extension-provided tools can be registered for later discovery, but the search metadata path was still owned by core-specific runtime hooks, which meant the sharedToolExecutorabstraction could not describe how a deferred extension tool should appear intool_search.Changes
ToolSearchEntryandToolSearchInfointocodex-toolsand re-export them from the shared tools crate.ToolExecutor::search_infoimplementation that derives loadable tool-search metadata from function and namespace specs.tool_search_entrymodule now that search metadata lives with the shared executor APIs.Testing
deferred_extension_tools_are_discoverable_with_tool_searchcoverage incore/src/tools/spec_plan_tests.rs.