pi-mono/packages
Petr Houška e033f255f0
fix(coding-agent): rank tools matching more query terms first in tool search (#11632)
Follow-up to #11625 (#11331). Same change in durable's copy: #11631.

Problem: #11625 made a query term in a tool's name outweigh any number
of description mentions. That regressed queries where another tool
matches more of the query in its description:
- `screenshot window`: `peekaboo__window` (name has `window`) beat
`peekaboo__image` ("Take a screenshot of the screen, an app, or a
window.").
- `describe app`: `peekaboo__app` (whole name `app`) beat
`peekaboo__see` ("... describe the UI elements of the app.").

Fix: `Bm25Ranker` sorts by coverage first: a tool matching more of the
query's distinct terms, in any field (name, description and schema,
namespace), ranks above one matching fewer, whatever the scores. Within
the same coverage, the score decides as before. A query that is exactly
a tool's name still ranks that tool first.

On the 16-tool set from #11631 (5 servers, 16 queries), this fixes both
regressions and changes nothing else; `search github issues` stays at
rank 5, since `list_issues` lacks "search" and ties on coverage with
`search_code` and `linear__search_issues`.

Changelog: updates the unreleased #11331 entry from #11625.
2026-10-30 23:07:43 +01:00
..
agent fix(ai,chord,durable,coding-agent): parse streamed tool-call arguments incrementally (fixes #9265) 2026-10-24 08:00:07 +00:00
ai fix(ai): do not retry Zhipu usage limit errors (code 1308) (#11572) 2026-10-29 15:37:07 +01:00
chord docs(chord): slice 10 points D9-D12, RouteHandle.retry, design §23 folded 2026-10-30 21:12:13 +00:00
codemode fix: update deps for security advisories 2026-10-22 11:24:50 +02:00
coding-agent fix(coding-agent): rank tools matching more query terms first in tool search (#11632) 2026-10-30 23:07:43 +01:00
durable feat(durable): beforeProviderRequest generation hook (#11619) 2026-10-30 18:15:05 +01:00
env fix(env): report watch overflow when a change list exceeds the frame limit (#11605) 2026-10-30 12:15:09 +01:00
evals feat(coding-agent): add prompt template documentation eval (#10261) 2026-10-28 12:12:19 +02:00
mcp fix(ai,chord,durable,coding-agent): parse streamed tool-call arguments incrementally (fixes #9265) 2026-10-24 08:00:07 +00:00
telemetry fix(ai): resolve pi-telemetry from source in workspace tests 2026-10-26 21:05:54 +00:00
tui fix(tui): detect Orca terminals as Kitty-image capable (#9329) 2026-10-29 22:11:08 +01:00