Repository navigation
feat(tools): Rerank unclear tool search matches with the fast model - #2904
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
force-pushed
the
feat/tool-search-model-rerank
branch
from
November 7, 2026 21:14
d62ecb9 to
89cee0b
Compare
When the word match cannot tell which tool fits, send the top 20 candidates to the fast model. It picks up to 3 of them, or none. A clear winner skips the model. Refs #2893 Co-Authored-By: David Cramer <[email protected]>
CI has no AI Gateway credentials, so unclear queries failed there.
A query such as "automation list update channel" dropped searchAutomations below the score cutoff, because "list" did not match the search action. A list query now also matches search tools at the synonym weight. A search query still does not match list tools.
Main now sends core model calls through @/chat/core-model, which names each operation and where its cost goes, and no longer accepts temperature. The rerank call now uses it as tool_search_rerank, and a run passes its Conversation and Turn as the cost owner. Main's new issue comment tool shares the update action with issue tools, so "edit my issue comment" and "modify an issue" now go to the model.
sentry-junior
Bot
force-pushed
the
feat/tool-search-model-rerank
branch
from
November 12, 2026 20:40
b990c45 to
2818ebb
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2818ebb. Configure here.
Contributor
|
13 screenshot changes — 13 changed · 0 added · 0 removed Review screenshots in Frameshift Show 7 more changed screenshots |
A rerank answer with names that are all outside the candidate list is a bad answer, not a choice of none. Keep the word match and log tool_search.rerank.failed, like a timeout.
createPiAgentTools now takes an options object, and searchToolsCost has
no default. A new caller must choose who pays for the rerank call.
Tests and evals pass { owner: "none" }.
Co-Authored-By: David Cramer <[email protected]>
dcramer
approved these changes
Nov 12, 2026
23 tasks done
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.

Stacked on #2903. Part of #2893.
searchToolsstill 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.app.tool_search.rerank.*(TELEMETRY.md "Tool Search").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 throughsearchToolswith no model. The newclassifierseval (tool-search.eval.ts) runs the model path with the real model.via @dcramer.
--
View Session [Sentry]