feat(deferred): add fuzzy search matching for tool discovery#3738
Merged
Conversation
Member
|
We are using fzf in this project for other things, let's use fzf also for this search, WDYT? |
Piyush0049
force-pushed
the
feat/fuzzy-deferred-tools
branch
from
July 18, 2026 12:11
8894f14 to
080002e
Compare
Contributor
Author
Hmm, I think that would be better. I just removed the custom matcher and swapped it over to use fzf. It's actually way better this way since we can use the match score to rank the results. |
Member
|
Amazing, thanks! |
aheritier
added a commit
that referenced
this pull request
Jul 19, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR addresses the
TODO: fuzzy searchin the deferred toolset by replacing the rigid substring search with a lightweight fuzzy matching algorithm.When an agent uses
search_toolto discover deferred tools, it can now successfully match acronyms or partial words (e.g. searching for "crfil" will correctly match the "create_file" tool).Changes Made
fuzzyMatchhelper function topkg/tools/builtin/deferred/deferred.gothat verifies if all characters in the query string appear in the target string in relative order.handleSearchToolto usefuzzyMatchagainst both the tool name and tool description, and removed the inline TODO comment.fuzzy search by nameandfuzzy search by descriptiontest cases indeferred_test.goto ensure correctness.Validation
go test ./pkg/tools/builtin/deferred/...suite passes successfully.gofumptto comply with repository standards.