Skip to content

fix: tokenize plugin search queries so multi-word terms match - #288

Open
ayushsingh82 wants to merge 1 commit into
agentrhq:mainfrom
ayushsingh82:fix/282-plugin-search-tokenize
Open

fix: tokenize plugin search queries so multi-word terms match#288
ayushsingh82 wants to merge 1 commit into
agentrhq:mainfrom
ayushsingh82:fix/282-plugin-search-tokenize

Conversation

@ayushsingh82

Copy link
Copy Markdown

Summary

  • searchCatalogPlugins matched the query as one literal substring, so a multi-word query like hacker news missed the hackernews plugin even though hackernews and hacker alone both matched.
  • The query is now split into tokens, non-alphanumerics are stripped from both tokens and the name/description haystack, and every token must match — so hacker news, hacker-news, and hackernews all hit.

Fixes #282

Test plan

  • npx tsc --noEmit
  • Added regression tests in src/plugin-catalog.test.ts covering the exact repro from the issue and confirming multi-token queries still require every token to match; verified they fail against the pre-fix code and pass after.

searchCatalogPlugins tested the query as one literal substring, so
"hacker news" missed the hackernews plugin even though "hackernews"
and "hacker" alone both matched. Split the query into tokens, strip
non-alphanumerics from tokens and haystack, and require every token to
match — so "hacker news", "hacker-news", and "hackernews" all hit.

Fixes agentrhq#282
@github-actions

Copy link
Copy Markdown
Contributor

🟢 No documentation gap found — medium confidence

The automated review found no documentation gap in the supplied changes.

This review is advisory and does not block merging.

@ayushsingh82

Copy link
Copy Markdown
Author

Fixes #282@ngaurav multi-word plugin search (e.g. "hacker news") now resolves correctly. Ready for review.

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.

plugin search: multi-word queries return nothing ("hacker news" misses hackernews)

1 participant