Skip to content

feat(deferred): add fuzzy search matching for tool discovery#3738

Merged
rumpl merged 1 commit into
docker:mainfrom
Piyush0049:feat/fuzzy-deferred-tools
Jul 18, 2026
Merged

feat(deferred): add fuzzy search matching for tool discovery#3738
rumpl merged 1 commit into
docker:mainfrom
Piyush0049:feat/fuzzy-deferred-tools

Conversation

@Piyush0049

Copy link
Copy Markdown
Contributor

Summary

This PR addresses the TODO: fuzzy search in the deferred toolset by replacing the rigid substring search with a lightweight fuzzy matching algorithm.

When an agent uses search_tool to 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

  • Fuzzy Match Algorithm: Added a dependency-free fuzzyMatch helper function to pkg/tools/builtin/deferred/deferred.go that verifies if all characters in the query string appear in the target string in relative order.
  • Search Update: Updated handleSearchTool to use fuzzyMatch against both the tool name and tool description, and removed the inline TODO comment.
  • Test Coverage: Added explicit fuzzy search by name and fuzzy search by description test cases in deferred_test.go to ensure correctness.

Validation

  • The full go test ./pkg/tools/builtin/deferred/... suite passes successfully.
  • The files have been formatted cleanly using gofumpt to comply with repository standards.

@Piyush0049
Piyush0049 requested a review from a team as a code owner July 18, 2026 12:06
@rumpl

rumpl commented Jul 18, 2026

Copy link
Copy Markdown
Member

We are using fzf in this project for other things, let's use fzf also for this search, WDYT?

@Piyush0049
Piyush0049 force-pushed the feat/fuzzy-deferred-tools branch from 8894f14 to 080002e Compare July 18, 2026 12:11
@Piyush0049

Piyush0049 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

We are using fzf in this project for other things, let's use fzf also for this search, WDYT?

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.
I have pushed the changes. Please do let me know your POV and any other changes required.

@rumpl rumpl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

@rumpl

rumpl commented Jul 18, 2026

Copy link
Copy Markdown
Member

Amazing, thanks!

@rumpl
rumpl merged commit 5339608 into docker:main Jul 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants