warn that issue_write body REPLACES content, not appends (fixes #2410)
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:
- "Close issue #42 and explain why it was fixed" → agent overwrites the original body with a closing note
- "Mark issue #17 as duplicate and leave a note" → agent replaces body with "duplicate of #X"
- "Update issue #8 status to closed with resolution" → body silently destroyed
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— thebodyparameter descriptionpkg/github/__toolsnaps__/issue_write.snap— regenerated viaUPDATE_TOOLSNAPS=true go test ./pkg/github -run ^Test_CreateIssue$README.md— regenerated viago 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_CreateIssuepassesgo 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.
Rebased onto current main (head b7808ec). The change is still just the single description-string swap on issue_write.body (Go source + toolsnap + auto-gen README) and all three files match. Could a maintainer add ok-to-test so CI can run? Happy to address review comments — fixes #2410.
Addressed @Copilot's two review comments in 7f20410: dropped the secondary does NOT shouting (kept REPLACES as the single emphatic warning, since that's the whole point of #2410), tightened phrasing, and regenerated the three doc surfaces. Net change is still 5 lines across 5 files (single description string + 3 regenerated doc views + 1 snap).
Picked this up from the work queue — found and fixed a CI-blocking toolsnap mismatch that would fail once ok-to-test runs.
Root cause
The description change was applied to IssueWrite (feature-flag-enabled) and the canonical issue_write.snap, but:
LegacyIssueWritestill had the old"Issue body content"description (this variant ownsissue_write.snapperTest_LegacyIssueWrite_Definition)issue_write_ff_remote_mcp_issue_fields.snapwas never regenerated (owned byTest_UpdateIssue)
Running the snapshot tests locally reproduces both failures:
Test_LegacyIssueWrite_Definition — snap has new text, LegacyIssueWrite code does not
Test_UpdateIssue — IssueWrite has new text, ff snap does not
Fix (commit d991333)
- Applied the same body description to
LegacyIssueWriteinpkg/github/issues.go - Regenerated
issue_write_ff_remote_mcp_issue_fields.snapviaUPDATE_TOOLSNAPS=true go test ./pkg/github -run 'Test_LegacyIssueWrite_Definition|Test_UpdateIssue' - Rebased the branch onto current
main(wasBEHIND) go test ./...passes locally
Branch with the fix: https://github.com/advancedresearcharray/github-mcp-server/tree/fix/issue_write-body-description-2410
To pull into this PR:
git fetch https://github.com/advancedresearcharray/github-mcp-server.git fix/issue_write-body-description-2410
git cherry-pick d991333 # or reset/rebase onto that branch
git push
Happy to adjust if maintainers prefer a different approach. A maintainer ok-to-test label would let CI confirm.