Repository navigation
enable tool search over dynamic tools - #18263
Merged
Merged
Conversation
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
sayan-oai
changed the base branch from
codex/search-deferred-dynamic-tools
to
main
April 17, 2026 10:05
sayan-oai
force-pushed
the
codex/tool-search-entry-adapter-cleanup
branch
from
April 17, 2026 10:55
dba0847 to
c955ab8
Compare
sayan-oai
marked this pull request as ready for review
April 17, 2026 10:55
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
| ToolSearchOutputTool::Function(tool) => { | ||
| tools.push(ToolSearchOutputTool::Function(tool.clone())); | ||
| } | ||
| ToolSearchOutputTool::Namespace(namespace) => { |
Contributor
There was a problem hiding this comment.
why do we need this complicated logic? are we creating duplicated namespaces somewhere?
Contributor
There was a problem hiding this comment.
do we do the same namespace merging on normal path?
Contributor
Author
There was a problem hiding this comment.
its to avoid duplicate namespace entries while preserving search result order. dynamic tools can interleave results from the same namespace, so we merge later hits into the first namespace entry. the ideas being:
- we want to preserve search ordering
- we dont want to show the model repeated entries for the same namespace
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
approved these changes
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
pakrym-oai
reviewed
Apr 17, 2026
Contributor
Author
|
follow ups i noted but dont want to block this on:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ToolSearchEntryvalues before constructingToolSearchHandler.tools/handlersand intotools/tool_search_entry.rsso the handlers directory stays focused on handlers.ToolSearchHandleroperating over one generic entry list for BM25 search, namespace grouping, and per-bucket default limits.Why
Follow-up cleanup for #17849. The dynamic tool-search support made the handler juggle source-specific MCP and dynamic tool lists, index arithmetic, output conversion, and namespace emission. This keeps source adaptation outside the handler so the search loop itself is smaller and source-agnostic.
Validation
just fmtcargo test -p codex-core tools::handlers::tool_search::testsgit diff --checkcargo test -p codex-corecurrently fails in unrelatedplugins::manager::tests::list_marketplaces_ignores_installed_roots_missing_from_config; rerunning that single test fails the same way atcore/src/plugins/manager_tests.rs:1692.