Repository navigation
feat(tools): Rank tool names by action and object, and say when no tool fits - #2903
Merged
Merged
Conversation
…ol fits Split each tool name into an action word and object words, and boost tools whose action and object both match the query. When one tool has the query's action and another has its object, but no tool has both, return no tools and a note instead of a guess. The ranking test now adds a second issue plugin with snake_case tool names, so it covers overlapping tools from two plugins. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
11 screenshot changes — 11 changed · 0 added · 0 removed Review screenshots in Frameshift |
dcramer
approved these changes
Nov 7, 2026
23 tasks done
dcramer
added a commit
that referenced
this pull request
Nov 12, 2026
…2904) Stacked on #2903. Part of #2893. `searchTools` still ranks by word match first. When the word match is unclear, the fast model picks from the top 20 candidates. Unclear means: the best tool's name lacks the query's action and object, the next score is within 70% of the best, or the #2903 no-fit rule fired. The model returns up to 3 candidate names, or none. Names that are not candidates are dropped. A clear winner skips the model. - A timeout (5s) or a transient provider failure keeps the word match. Other failures go to the tool call. - The query and tool text go in the prompt as escaped data. - Telemetry: `app.tool_search.rerank.*` (TELEMETRY.md "Tool Search"). - About 1,000 input tokens per call at 20 candidates. Tests: the test architecture check does not allow model fakes in `packages/junior/tests`. So the ranking tests check the word match and which queries go to the model, and a clear search runs through `searchTools` with no model. The new `classifiers` eval (`tool-search.eval.ts`) runs the model path with the real model. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Ac153e1c8612191d35fbd9fa76faa8da2 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Ac153e1c8612191d35fbd9fa76faa8da2) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ac153e1c8612191d35fbd9fa76faa8da2/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
This branch was successfully deployed
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.
Next step on #2893, after #2898.
Action and object from tool names.
searchToolssplits each tool name (camelCase or snake_case, without the source prefix) into an action word and object words:commentOnIssueandcreate_issuegive "comment"/"create" and "issue". When the query matches the action (synonyms count) and the object, the score goes up by as much as 2x. This works for any plugin or MCP tool, and plugins don't need to add anything.No guess when nothing fits. If one tool has the query's action and another has its object, but no tool has both, search returns no tools and a
note. "create repository" used to returncreateIssue. Any empty search now has the note.Crowded ranking test. It adds a fake
trackerplugin withcreate_issue,get_issueandcomment_on_issue, set up through the real plugin wiring. The new cases check:source, the right plugin's tool ranks firstsource, a provider name in the query picks the toolThe two-step source selection planned next should fix that last case.
createIssuecreateIssue,tracker_create_issue, …createMemorysubmitPullRequestReviewgetPullRequestAll new cases come from tool descriptions.
via @dcramer.
--
View Session [Sentry]