Skip to content

fix(tools): clarify search_code path: vs filename: (#2343)#2365

Open
beejak wants to merge 1 commit intogithub:mainfrom
beejak:fix/search-code-path-filename-hint-2343
Open

fix(tools): clarify search_code path: vs filename: (#2343)#2365
beejak wants to merge 1 commit intogithub:mainfrom
beejak:fix/search-code-path-filename-hint-2343

Conversation

@beejak
Copy link
Copy Markdown

@beejak beejak commented Apr 22, 2026

Summary

  • Extend the \search_code\ query schema description so \path:\ (directory prefix) vs \ ilename:\ (file name) is explicit.
  • When GitHub returns zero code results and the query uses \path:\ with a file-like token (contains ., no path separators), append a second text content block pointing agents at \ ilename:.

Context

Addresses the confusion described in #2343 (silent empty results when \path:\ is used like a filename filter).

Test plan

  • \go test ./pkg/github -run 'Test_SearchCode|TestPathQualifier' -count=1\
  • \UPDATE_TOOLSNAPS=true go test ./pkg/github -run '^Test_SearchCode$' -count=1\ (schema snap updated)

Document path: (directory prefix) vs filename: in the query schema. When GitHub returns zero code results and the query uses path: with a file-like token, append a second text block so agents see why results may be empty.

Made-with: Cursor
@beejak beejak requested a review from a team as a code owner April 22, 2026 13:56
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.

1 participant