Skip to content

Fix issue_write silently dropped label errors - #3195

Merged
SamMorrowDrums merged 1 commit into
mainfrom
sammorrowdrums-fix-issue-write-label-errors
Sep 1, 2026
Merged

Fix issue_write silently dropped label errors#3195
SamMorrowDrums merged 1 commit into
mainfrom
sammorrowdrums-fix-issue-write-label-errors

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

Summary

Detect when GitHub accepts an issue create or update request but omits requested labels, and return a precise partial-failure result instead of reporting success.

Why

GitHub can silently ignore labels when the caller lacks AddLabelsToLabelable permission while still creating or updating the issue successfully.

Fixes #3160

What changed

  • Compare requested labels with the authoritative label set returned by the existing create/PATCH response, without an additional readback.
  • Return an MCP error containing the issue URL plus requested, applied, missing, and unexpected labels; cover create, update, and failed label clearing with focused tests.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed — issue_write now reports partial failure when requested labels are not applied.
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered — the error identifies AddLabelsToLabelable as a likely permission boundary without claiming it is the only possible cause.
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed — the input schema is unchanged.
  • Updated (README / docs / examples)

Compare requested labels with the authoritative issue returned by create and update writes, and return a precise partial-failure result when GitHub omits them.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@SamMorrowDrums
SamMorrowDrums requested a review from a team as a code owner September 1, 2026 08:18
Copilot AI balanced review requested due to automatic review settings September 1, 2026 08:18

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.

Copilot review overview

🟢 Approval recommended

The implementation correctly detects label mismatches and includes focused regression coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Adds partial-failure detection when issue_write silently fails to apply requested labels.

Changes:

  • Compares requested and returned label sets.
  • Reports missing/unexpected labels with the issue URL.
  • Adds focused create, update, and label-clearing tests.
File Description
pkg/​github/​issues.go Adds label reconciliation and partial-failure responses.
pkg/​github/​issues_test.go Tests unapplied-label scenarios without readback requests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@SamMorrowDrums
SamMorrowDrums merged commit 7b6646c into main Sep 1, 2026
20 checks passed
@SamMorrowDrums
SamMorrowDrums deleted the sammorrowdrums-fix-issue-write-label-errors branch September 1, 2026 13:15
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.

github_issue_write silently drops labels when caller lacks AddLabelsToLabelable permission

2 participants