ListLabelsOutput drops every label id from the typed response
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
pkg/github/typed_governance_outputs.go を開き、16 行目付近の MinimalLabel と、ListLabelsOutput を埋める 461 行目付近のデコード箇所を読んでください。MinimalLabel に json:"id" タグ付きの ID int64 フィールドを追加して、レガシーな identity がデコードと再エンコードを経ても残るようにし、出力スキーマにも同じフィールドが必要か確認してください。次に、id が保持されることを検証するラウンドトリップテスト(報告された TestListLabelsDropsID のようなもの)を追加し、go test ./pkg/github を実行してください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Go
- スター
- 34.4k
- フォーク
- 5.3k
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 30
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/github-mcp-server のほかの issue
-
create_or_update_file rejects explicitly empty file content対応中かも @Elon-Jiang が 4 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/github-mcp-server#3883 ·
メンテナーはふだん 4 日以内に返信
-
csv_output silently overwrites distinct fields when flattened keys collide対応中かも @Mystery01092000 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/github-mcp-server#3865 ·
メンテナーはふだん 4 日以内に返信
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labels対応中かも @shhhhhhjokerist が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
github/github-mcp-server#3760 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
docs(install-claude): "environment variable" examples put the PAT in argv and the saved config対応中かも @shhhhhhjokerist が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
github/github-mcp-server#3758 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
github/github-mcp-server#3729 ·
メンテナーはふだん 4 日以内に返信
github/github-mcp-server の issue をすべて見る
似ている issue
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'対応中かも @Aryanbhargava18 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Hybrid search silently caps the BM25 candidate pool at 20 even with a higher --limit対応中かも @aloneangel45 が今日担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
channel/http: constructRequest produces double slashes when baseAddress or HTTPEndpoint BaseURL has a trailing slash対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信