fix(tool): clarify semantic_search returns snippets not file paths (#10142)

* fix(tool): clarify semantic_search returns snippets not file paths

The first description bullet read "Find files most relevant to the
search query using semantic search.", which led an AI agent to tell a
user that the tool returns file paths only. The tool actually returns
matching content with file paths, line ranges, and relevance scores.

Updates the first two description bullets to name the output shape
directly. No runtime change.

Closes #9767.

* test(cli): cover semantic_search description

---------

Co-authored-by: marius-kilocode <marius@kilocode.ai>
This commit is contained in:
Truffle
2026-05-11 14:15:41 +00:00
committed by GitHub
co-authored by marius-kilocode
parent 1b452c6cb8
commit 00313bfcd4
3 changed files with 15 additions and 1 deletions
@@ -34,6 +34,14 @@ const baseCtx = {
} satisfies Tool.Context
describe("tool.semantic_search", () => {
test("describes code snippet results", async () => {
const tool = await initTool()
expect(tool.description).toContain("Find code snippets most relevant")
expect(tool.description).toContain("Returns matching content with file paths, line ranges, and relevance scores")
expect(tool.description).not.toContain("Find files most relevant")
})
test("throws when query is empty", async () => {
const tool = await initTool()
expect(rt.runPromise(tool.execute({ query: "" }, baseCtx))).rejects.toThrow("query is required")