Skip to content

warn that issue_write body REPLACES content, not appends (fixes #2410)#2443

Open
jluocsa wants to merge 1 commit intogithub:mainfrom
jluocsa:fix/issue_write-body-description-2410
Open

warn that issue_write body REPLACES content, not appends (fixes #2410)#2443
jluocsa wants to merge 1 commit intogithub:mainfrom
jluocsa:fix/issue_write-body-description-2410

Conversation

@jluocsa
Copy link
Copy Markdown

@jluocsa jluocsa commented May 8, 2026

Summary

Fixes #2410.

The body parameter on issue_write (method='update') replaces the entire issue body — matching REST API semantics, but LLM agents frequently misinterpret body as "add a note about this issue" and end up silently destroying the original issue description. Real-world examples from the linked issue:

This PR updates the body parameter description to make the replace-not-append semantics explicit and to point users at add_issue_comment for the common "leave a note" use case.

This is option 1 from the issue (description-only fix). Option 2 (a separate comment parameter) would be a larger schema change; happy to follow up with that as a separate PR if desired.

Before

Issue body content

After

Issue body content (Markdown). On method='update', this REPLACES the entire issue body, it does NOT append. To add a comment to an issue without modifying its body, use the add_issue_comment tool instead.

Files changed (3 files / 3 lines)

  • pkg/github/issues.go — the body parameter description
  • pkg/github/__toolsnaps__/issue_write.snap — regenerated via UPDATE_TOOLSNAPS=true go test ./pkg/github -run ^Test_CreateIssue$
  • README.md — regenerated via go run ./cmd/github-mcp-server generate-docs

The granular issue tools (update_issue_body, add_issue_comment) don't have this confusion and were not modified.

Validation

  • Test_CreateIssue passes
  • go test ./... passes for all 22 packages
  • Toolsnap diff is exactly the description string change
  • README diff is exactly the description string change

Note: I was unable to run script/lint locally (no golangci-lint available in my environment). CI should validate it. Happy to iterate if anything surfaces.

The `body` parameter on `issue_write` (method='update') replaces the
entire issue body, matching REST API semantics. However, LLM agents
frequently misinterpret `body` as "add a note about this issue" and
end up silently destroying the original issue description (github#2410).

Update the parameter description to make the replace-not-append
semantics explicit and to point users at `add_issue_comment` for the
common "leave a note" use case.

Updates the issue_write toolsnap and README accordingly.

Fixes github#2410.
@jluocsa jluocsa requested a review from a team as a code owner May 8, 2026 03:17
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.

issue_write body parameter overwrites issue content on update — easily confused with adding a comment

1 participant