Repository navigation
Conversation
…utputs Previously empty collections were omitted via omitempty, making "no labels" indistinguishable from "labels not returned". issue_read now always returns labels and comments; pull_request_read always returns labels, assignees and requested_reviewers. The fields are now required in the output schemas. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are outstanding for the changes that make empty collections explicit in issue and pull request outputs.
No open issues 🎉
What changed in this PR
This PR makes empty collections explicit in GitHub MCP Server issue and pull request outputs, allowing clients to distinguish “empty” from “not returned.”
Changes:
- Always emit issue labels and comment counts, plus pull request labels, assignees, and requested reviewers.
- Initialize empty collections as
[]and mark the corresponding output schema fields as required. - Update wire-output expectations and schema tests while keeping pull request counts optional.
| File | Description |
|---|---|
pkg/github/typed_issue_outputs_test.go |
Expect empty labels and zero comments in issue outputs. |
pkg/github/typed_granular_issue_outputs_test.go |
Update sub-issue output and schema expectations. |
pkg/github/typed_consolidated_pull_request_outputs_test.go |
Verify required empty pull request collections. |
pkg/github/typed_consolidated_issue_outputs_test.go |
Update consolidated issue output and schema cases. |
pkg/github/typed_consolidated_issue_enrichment_test.go |
Include empty labels and zero comments in enriched outputs. |
pkg/github/minimal_types.go |
Emit required fields and initialize empty collections. |
pkg/github/consolidated_issue_types.go |
Make typed issue labels and detail comment counts required. |
pkg/github/__toolsnaps__/sub_issue_write.snap |
Require labels in sub-issue mutation outputs. |
pkg/github/__toolsnaps__/reprioritize_sub_issue.snap |
Require labels in reprioritization outputs. |
pkg/github/__toolsnaps__/remove_sub_issue.snap |
Require labels in sub-issue removal outputs. |
pkg/github/__toolsnaps__/pull_request_read.snap |
Require labels, assignees, and requested reviewers. |
pkg/github/__toolsnaps__/issue_read.snap |
Require labels and issue-detail comment counts. |
pkg/github/__toolsnaps__/add_sub_issue.snap |
Require labels in sub-issue addition outputs. |
Review effort: Balanced (auto)
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
Issue and PR read outputs now always include
labelsand other core collections (as[]when empty) instead of omitting them, so "no labels" is distinguishable from "not returned".Why
issue_readgetdroppedlabelsentirely for unlabeled issues (viaomitempty), whileassigneeswas always present as[]. Nothing in the output schema explained that a missing key means "empty", so agents could reasonably treat it as unknown and make an extraget_labelscall. This extends the existingMinimalIssue.Assigneesconvention.What changed
MinimalIssue:labelsandcommentsare always emitted (non-nil[]/0).IssueDetailsOutputandSubIssueOutput:labels(andcommentsfor details) no longeromitempty.MinimalPullRequest:labels,assignees,requested_reviewersalways emitted as non-nil lists.requiredin the output schemas.MCP impact
issue_read(get,get_sub_issues),pull_request_read(get) andsub_issue_writeoutputs now always include these fields. Because the structs are shared,list_issues,search_issuesandlist_pull_requeststext output also gains the empty lists. PR counts (additions,commits,comments, …) intentionally remainomitemptybecauselist_pull_requestsdoesn't populate them, so emitting0would be misleading.Prompts tested (tool changes only)
"labels": []fromissue_readget.Security / limits
Adds a few bytes per item for empty lists.
Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint— golangci-lint not installed locally;go vetandgofmtclean, relying on CI../script/test(go test ./...passes)Docs
./script/generate-docsproduces no changes.