ListLabelsOutput drops every label id from the typed response
Maintainers usually reply within 3 days
@Shanmukh-l33t is already working on this.
Since Nov 22, 2026.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
Research direction
Open pkg/github/typed_governance_outputs.go and read MinimalLabel near line 16 plus the decode site around line 461 that fills ListLabelsOutput. Add an ID int64 field with the json:"id" tag to MinimalLabel so the legacy identity survives decode and re-encode, and check whether the output schema needs the same field. Then add a round-trip test (like the reported TestListLabelsDropsID) asserting id is preserved and run go test ./pkg/github.
Written by the indexing model from the issue text.
Description
ListLabelsOutput drops every label id from the typed response
Summary
The legacy list_label producer serializes each label's id, but the typed ListLabelsOutput decodes into MinimalLabel, which has no id field. A round-trip through the typed output therefore removes every label id.
Location
- Repository:
github/github-mcp-server - File:
pkg/github/typed_governance_outputs.go - Line: 16 (
MinimalLabel; decode at 461) - Revision:
e3809fe91c75
Affected code
type MinimalLabel struct {
Name string `json:"name"`
Color string `json:"color" jsonschema:"Hex RGB without leading #."`
Description string `json:"description"`
}
type ListLabelsOutput struct {
Labels []MinimalLabel `json:"labels"`
TotalCount int `json:"totalCount" jsonschema:"Total labels in the repository."`
PageInfo MinimalPageInfo `json:"pageInfo"`
}
The legacy JSON carries id, but the typed struct has no destination for it.
Expected behavior
A typed ListLabelsOutput preserves the legacy label identity. Round-tripping:
{"labels":[{"id":123,"name":"bug","color":"ff0000","description":""}],"totalCount":1,"pageInfo":{}}
must keep id: 123, or the typed output must not be used for a lossless interpretation of the legacy response.
Actual behavior
Running a round-trip test in Docker:
docker run --rm -v "$PWD:/app" -v /tmp/gomod:/go/pkg/mod -v /tmp/gocache:/root/.cache/go-build -w /app -e GOFLAGS=-mod=mod golang:1.26 bash -c 'go mod download && go test ./pkg/github -run TestListLabelsDropsID -v'
Observed:
roundtrip={"labels":[{"name":"bug","color":"ff0000","description":""}],"totalCount":1,"pageInfo":{"hasNextPage":false,"hasPreviousPage":false}}
--- PASS: TestListLabelsDropsID
id is gone after the typed decode/encode.
Root cause
MinimalLabel declares only name, color, and description. encoding/json silently ignores the legacy id field, and re-encoding the typed value emits no id.
The current default branch still has the same MinimalLabel definition.
Suggested fix
Add the identity field to the typed model:
type MinimalLabel struct {
ID int64 `json:"id"`
Name string `json:"name"`
Color string `json:"color" jsonschema:"Hex RGB without leading #."`
Description string `json:"description"`
}
and include it in the output schema. Add a round-trip test asserting id survives.
- Dominant language
- Go
- Stars
- 34.8k
- Forks
- 5.4k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 31
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/github-mcp-server
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
github/github-mcp-server#3960 ·
Maintainers usually reply within 3 days
-
Scope-challenge middleware fails open when the token-scope fetch returns an errorPossibly taken @Shanmukh-l33t claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/github-mcp-server#3929 ·
Maintainers usually reply within 3 days
-
create_or_update_file rejects explicitly empty file contentPossibly taken @Elon-Jiang claimed this 8 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
github/github-mcp-server#3883 ·
Maintainers usually reply within 3 days
-
csv_output silently overwrites distinct fields when flattened keys collidePossibly taken @Mystery01092000 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/github-mcp-server#3865 ·
Maintainers usually reply within 3 days
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labelsPossibly taken @shhhhhhjokerist claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
github/github-mcp-server#3760 · 2 comments ·
Maintainers usually reply within 3 days
All issues in github/github-mcp-server
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
JuliusBrussee/caveman#1594 ·
Maintainers usually reply within 1 day
-
C-bug O-community X-blathers-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
cockroachdb/cockroach#176264 · 1 comment ·
-
security trivy
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
kubefleet-dev/kubefleet#1068 ·
Maintainers usually reply within 3 days