- Notifications
You must be signed in to change notification settings - Fork3.1k
Separate org and user search#486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR separates organization searches from user searches by introducing dedicated tools and refactoring common logic.
- Registers a new
orgstoolset inInitToolsets. - Refactors search handlers with
userOrOrgHandlerand adds a (currently unused)minimalAccountSearchHandler. - Implements
SearchOrgsfunction and its tests insearch_test.go.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/github/tools.go | Added and registered"orgs" toolset alongside existing toolsets |
| pkg/github/search.go | Refactored search logic, addeduserOrOrgHandler,SearchOrgs, and residualminimalAccountSearchHandler |
| pkg/github/search_test.go | AddedTest_SearchOrgs suite to validate organization search tool |
Comments suppressed due to low confidence (3)
pkg/github/search.go:163
- The
minimalAccountSearchHandlerfunction is never used. Consider removing it or integrating it into theuserOrOrgHandlerto avoid dead code.
func minimalAccountSearchHandler(accountType string, query string, getClient GetClientFn, ctx context.Context, sort, order string, pagination PaginationParams) {pkg/github/search.go:335
- [nitpick] The translation key
TOOL_SEARCH_ORGS_USER_TITLEincludesUSERalthough this is for organizations; consider renaming it toTOOL_SEARCH_ORGS_TITLEfor consistency.
mcp.WithToolAnnotation(mcp.ToolAnnotation{ Title: t("TOOL_SEARCH_ORGS_USER_TITLE", "Search organizations"),pkg/github/search_test.go:521
- [nitpick] Tests for
SearchOrgscover the default pagination but don’t verify behavior when non-defaultsort,order, or pagination parameters are provided. Consider adding cases to cover those parameters.
requestArgs: map[string]interface{}{Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
52d0bf0 to6c70992Comparecaea5e0 toba7bc51Compareacba284 intomainUh oh!
There was an error while loading.Please reload this page.
In order to make separation of certain objects more clear we should separate them. This means orgs and users are not the same.
A follow-up will be to separate issue and PR search by also scoping the queries and producing separate functions. It is best for the LLM that it has clear boundaries, and concepts are consistent, rather than accepting the legacy API quirks.