| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Reasoning for why OSS as opposed to the remote server is detailed in github/plan-track-agentic-toolkit#729 (tradeoffs dropdown) — tl;dr: making a change to expose Client.BaseURL() to handle GHES cases was relatively cheap, we keep one source of truth for the tool description and avoid patching the tool with semantic-specific overrides in the remote repo, and make future changes easier to eval. I'm open to discussing this though! |
Sorry, something went wrong.
There was a problem hiding this comment.
Makes issue search semantic by default on supported hosts, with lexical fallback for GHES.
Changes:
| File | Description |
|---|---|
| README.md | Updates query guidance. |
| pkg/utils/api.go | Exposes host classification. |
| pkg/github/tools.go | Adds host-aware tool options. |
| pkg/github/search_utils.go | Implements semantic search preparation. |
| pkg/github/search_semantic_test.go | Tests quote handling and descriptions. |
| pkg/github/issues.go | Makes issue search host-aware. |
| pkg/github/issues_test.go | Updates semantic request expectations. |
| pkg/github/inventory.go | Propagates tool options. |
| pkg/github/__toolsnaps__/search_issues.snap | Updates default schema snapshot. |
| pkg/github/__toolsnaps__/search_issues_ff_fields_param.snap | Updates flagged schema snapshot. |
| internal/ghmcp/server.go | Configures host type for stdio. |
| docs/insiders-features.md | Updates generated query guidance. |
| docs/feature-flags.md | Updates generated query guidance. |
Sorry, something went wrong.
There was a problem hiding this comment.
pkg/github/issues.go:1679
Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription),
pkg/github/search_utils.go:163
protected := qualifierQuotePattern.ReplaceAllString(query, "${1}"+sentinel+"${2}"+sentinel)
stripped := strings.ReplaceAll(protected, `"`, "")
return strings.ReplaceAll(stripped, sentinel, `"`)
pkg/github/issues.go:1694
result, err := searchIssuesHandler(ctx, deps, args, mode, options...)
Sorry, something went wrong.
| @@ -1647,7 +1676,7 @@ func SearchIssues(t translations.TranslationHelperFunc) inventory.ServerTool { | |||
| ToolsetMetadataIssues, | |||
| mcp.Tool{ | |||
| Name: "search_issues", | |||
| Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", "Search for issues in GitHub repositories using issues search syntax already scoped to is:issue"), | |||
| Description: t("TOOL_SEARCH_ISSUES_DESCRIPTION", toolDescription), | |||
| Annotations: &mcp.ToolAnnotations{ | |||
| Title: t("TOOL_SEARCH_ISSUES_USER_TITLE", "Search issues"), | |||
| ReadOnlyHint: true, | |||
| @@ -1662,7 +1691,7 @@ func SearchIssues(t translations.TranslationHelperFunc) inventory.ServerTool { | |||
| return utils.NewToolResultError(err.Error()), nil, nil | |||
| } | |||
| options = append(options, withFieldsFiltering(deps, "search_issues", fields)) | |||
| result, err := searchIssuesHandler(ctx, deps, args, options...) | |||
| result, err := searchIssuesHandler(ctx, deps, args, mode, options...) | |||
| return result, nil, err | |||
| }) | |||
| } | |||
| @@ -1930,10 +1959,10 @@ func fetchIssueReadEnrichment(ctx context.Context, gqlClient *githubv4.Client, n | |||
| // searchIssuesHandler runs the REST issues search, enriches each hit with custom field values | |||
| // fetched via a single follow-up GraphQL nodes() query, and applies any post-process options | |||
| // (e.g. IFC labelling). | |||
| func searchIssuesHandler(ctx context.Context, deps ToolDependencies, args map[string]any, options ...searchOption) (*mcp.CallToolResult, error) { | |||
| func searchIssuesHandler(ctx context.Context, deps ToolDependencies, args map[string]any, mode searchMode, options ...searchOption) (*mcp.CallToolResult, error) { | |||
| const errorPrefix = "failed to search issues" | |||
|
|
|||
| query, opts, err := prepareSearchArgs(args, "issue") | |||
| query, opts, err := prepareSearchArgs(args, "issue", mode) | |||
| if err != nil { | |||
| return utils.NewToolResultError(err.Error()), nil | |||
| } | |||
There was a problem hiding this comment.
We might need to account for the translation cache here. In HTTP mode initGlobalToolScopeMap builds the tools without WithHost before the host-aware inventory is created. That caches the semantic description, which means a GHES server can advertise semantic search even though it correctly executes lexical search
Instead could we pass the configured host into the scope-map construction which should keep the description and behavior aligned
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Make search_issues use semantic search by default on hosts that support it, falling back to lexical on GHES.
Why
Closes github/plan-track-agentic-toolkit#729
An A/B experiment on the remote server compared lexical, semantic, hybrid and agent-chosen variants of search_issues over a week. Semantic reduced the number of searches an agent needed per session to 1.7, against lexical's 2.4, with query length roughly flat. Fewer searches means fewer round-trips of results into the agent's context.
Semantic search is not available on GitHub Enterprise Server, where the API returns 403 for search_type=semantic, so those hosts keep lexical behaviour.
What changed
advanced_search is deliberately left alone. The semantic query class already extends the advanced one, so the parameter changes nothing when semantic runs, and on the lexical fallback it makes things worse: under advanced search an unparenthesised boolean binds repo: to only its own clause, so the search escapes the repository the caller asked about. Prod-verified over four query shapes; the existing field. conditional in prepareSearchArgs is unchanged, since field genuinely does require it.
Eval details — how the query description was chosenThe query parameter description was picked by A/B testing four phrasings against a set of benchmark cases that prompt with synonym lists ("auth, authentication, or login problems") to see whether the model reaches for boolean OR. OR isn't supported by semantic search, so the query silently degrades to lexical.
Measured as: of the queries emitted for those cases, how many contained OR.
"When the user gives alternative wordings, include them as plain words rather than joining them with OR."
"Semantic matching already finds related wording, so synonyms don't need listing or joining with OR."
"Semantic matching already covers related wording and synonyms." (no mention of OR)
Findings:
MCP impact
search_issues descriptions changed, and the underlying search engine changes on non-GHES hosts. Parameters are unchanged.
Prompts tested (tool changes only)
Security / limits
Semantic issue search sits in a separate API rate limit family: 10 requests/minute versus 30/minute for standard search. This applies per request based on search_type, so making semantic the default lowers the effective rate limit for issue search on supported hosts. The experiment recorded no rate limit errors across ~76k semantic calls.
Tool renaming
Lint & tests
Docs