feat(search): add typed projected result outputs - #3386
Open
SamMorrowDrums wants to merge 2 commits into
Open
SamMorrowDrums wants to merge 2 commits into
SamMorrowDrums wants to merge 2 commits into
Conversation
SamMorrowDrums
added this pull request to stack #3385
October 2, 2026 10:51
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-search-projected-outputs
branch
from
October 2, 2026 11:02
41e57ce to
91f660e
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-search-projected-outputs
branch
2 times, most recently
from
October 2, 2026 20:50
7c2185f to
9cc1a97
Compare
Contributor
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Structured issue results lose meaningful empty field_values, and most inferred item schemas lack representative validation.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds typed, protocol-gated structured outputs to seven search and repository-list tools while retaining legacy text responses.
Changes:
- Adds typed inputs, projected output DTOs, and compatibility normalization.
- Gates output schemas and structured content by protocol version.
- Adds projection/schema tests and regenerates license reports.
| File | Description |
|---|---|
pkg/github/search.go |
Types search_code input and output. |
pkg/github/search_utils.go |
Types shared issue/PR search handling. |
pkg/github/issues.go |
Types issue search/list projections. |
pkg/github/pullrequests.go |
Types PR search/list projections. |
pkg/github/repositories.go |
Types branch and tag outputs. |
pkg/github/typed_read_normalizers.go |
Normalizes legacy typed arguments. |
pkg/github/typed_search_outputs_test.go |
Tests schemas, protocol gating, and projections. |
third-party-licenses.linux.md |
Consolidates Linux architecture licenses. |
third-party-licenses.windows.md |
Consolidates Windows architecture licenses. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Type *string `json:"type,omitempty"` | ||
| RepositoryURL *string `json:"repository_url,omitempty"` | ||
| PullRequest *SearchIssuePullRequest `json:"pull_request,omitempty"` | ||
| FieldValues []MinimalFieldValue `json:"field_values,omitempty"` |
Comment on lines
+111
to
+112
| case "search_code", "search_issues", "search_pull_requests": | ||
| return map[string]any{"total_count": 0, "incomplete_results": false, "items": []any{}} |
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-search-projected-outputs
branch
from
October 3, 2026 12:31
6a58bc1 to
eafea77
Compare
…tures Address review findings on the typed search/list projected-output tools (search_code, search_issues, search_pull_requests, list_issues, list_pull_requests, list_branches, list_tags): - issues.go/pullrequests.go: change FieldValues to a pointer-to-slice (*[]MinimalFieldValue) so a successful-but-empty [] is preserved in structuredContent, matching legacy text output instead of being dropped by omitempty. - search.go: related adjustments to keep typed search outputs aligned with the field_values presence fix. - typed_search_outputs_test.go: add representative nested/non-empty projected item fixtures so schema-conformance tests actually exercise item shapes instead of only validating empty collections. - Add/update toolsnaps for list_branches, list_issues, list_pull_requests, list_tags, search_code, search_issues, and search_pull_requests to reflect the schema. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-search-projected-outputs
branch
from
October 3, 2026 13:12
eafea77 to
1447006
Compare
SamMorrowDrums
marked this pull request as ready for review
October 3, 2026 13:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds typed inputs, compact output schemas, and protocol-gated structured results for seven search and repository-list read tools while preserving their legacy text output.
Why
This is the next migration layer in the typed-schema stack, making modern clients able to consume validated structured outputs without changing older-client behavior.
Fixes N/A — this stack layer has no linked issue.
What changed
search_code,search_issues,search_pull_requests,list_issues,list_pull_requests,list_branches, andlist_tagsto the typed registration path.fieldsprojections; retained existing text serializers, scope policies, error handling, and IFC labels.field_filtersparser.script/generate-docsproduced no documentation diff.MCP impact
Modern protocol clients receive output schemas and structured content for the seven migrated tools. Legacy/unknown clients retain their existing text output and behavior.
Prompts tested (tool changes only)
main.goand return only the name field.” — exercisedsearch_codewithfields: ["name"]and verified text/structured output match.list_tagsand verified legacy text and modern structured output.TestTypedProjectedReadToolOutputSchemas.Security / limits
Existing scope access declarations were preserved.
Structured DTOs remain compact and respect each tool’s existing
fieldsselection; IFC labeling and sanitization paths are preserved.Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/test./script/lintran but reports three govet diagnostics on unchanged parent-stack code:pkg/github/discussions.go:102:24,pkg/github/discussions.go:103:24, andpkg/lockdown/lockdown_test.go:92:70, eachinline: cannot inline: type parameter inference is not yet supported. Compatible checks passed with./bin/golangci-lint run --disable govet(0 issues)../script/testpassed. Focused tests passed withgo test ./pkg/github -run '^(TestTypedProjectedReadTool(OutputSchemas|OutputsRespectFieldSelection)|TestNormalizeTypedReadArgumentsPreservesLegacyValues|Test_SearchCode|Test_SearchIssues|Test_ListIssues|Test_ListPullRequests|Test_SearchPullRequests|Test_ListBranches|Test_ListTags)$' -count=1.script/generate-docspassed with no generated documentation changes. CI was still pending at the last check; the PR remains draft.Docs
script/generate-docscompleted successfully; it produced no changes because the input tool documentation did not change.