Skip to content

Retain label id in typed governance outputs - #3935

Open
HankGrimm wants to merge 1 commit into
github:mainfrom
HankGrimm:fix/list-labels-retain-id
Open

HankGrimm wants to merge 1 commit into
github:mainfrom
HankGrimm:fix/list-labels-retain-id

Conversation

@HankGrimm

@HankGrimm HankGrimm commented Nov 24, 2026 •

Copy link
Copy Markdown

Summary

Preserve the label's id on the typed get_label/list_label outputs so a round-trip through the typed model no longer drops it.

Why

MinimalLabel declared only name, color, and description, so encoding/json silently ignored the legacy id field and re-encoding emitted no id.

Fixes #3923

What changed

  • Add ID string to MinimalLabel (the legacy list_label/get_label producers emit the GraphQL label id as a string).
  • Add TestListLabelsOutputRetainsID asserting the id survives a typed decode/re-encode.
  • Update the get_label/list_label tool-schema snapshots.

MCP impact

  • Tool schema or behavior changed — get_label and list_label now include the label id in their typed output and output schema.

Prompts tested (tool changes only)

  • N/A — output-shape fix, covered by TestListLabelsOutputRetainsID and TestTypedGovernanceWireOutputs.

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

MinimalLabel dropped the label's id on the typed get_label/list_label
round-trip: it declared only name, color and description, so encoding/json
silently ignored the legacy id field and re-encoding emitted no id.

Add an ID field so the typed output preserves the label's GraphQL id.

Fixes github#3923

Co-Authored-By: Claude Code <noreply@anthropic.com>
@HankGrimm
HankGrimm requested a review from a team as a code owner November 24, 2026 02:56
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported, and the change is supported by projection and round-trip tests plus updated output-schema snapshots.

No open issues 🎉

What changed in this PR

Preserves GraphQL label IDs when legacy get_label and list_label responses are decoded into typed governance outputs and re-encoded.

Changes:

  • Added ID string to MinimalLabel.
  • Added projection and round-trip tests covering retained label IDs.
  • Updated get_label and list_label output-schema snapshots.
File Description
pkg/​github/​typed_governance_outputs.go Adds the label ID field to the typed governance output model.
pkg/​github/​typed_governance_outputs_test.go Verifies label IDs survive typed decoding and re-encoding.
pkg/​github/​__toolsnaps__/​list_label.snap Documents the required id property in the list_label output schema.
pkg/​github/​__toolsnaps__/​get_label.snap Documents the required id property in the get_label output schema.

Review effort: Lite (adaptive)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ListLabelsOutput drops every label id from the typed response

2 participants