feat: add work_item_update MCP tool#399
Merged
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom May 5, 2026
Merged
Conversation
Sister tool to work_item (#341 / Story 2.17) — that one creates issues/PRs; this one updates an existing GitHub/GitLab issue. Patch shape supports: - title — replace title - body — replace full body - body_section — replace ONE H2 section, preserving all other sections verbatim (the AC contract for #287; section is matched after normalizeHeading so case/whitespace variants all collapse to the same key) - labels / assignees — replacement semantics implemented as add/remove diff against the current set on disk (gh issue edit and glab issue update both expose only additive flags) - milestone — GitHub only; GitLab returns platform_unsupported because glab issue update --milestone needs a numeric id and group/project resolution this thin tool does not own - dry_run — short-circuit before invoking the platform CLI; returns the proposed updated_fields and the resolved_body for body_section patches Implementation lives in lib/adapters/work-item-update-{github,gitlab}.ts behind getAdapter() — the handler shell is platform-agnostic, gate-greps clean. Section splicing is in lib/work-item-section.ts so it is unit-tested in isolation. Test coverage: - 8 unit tests for spliceH2Section (lib/work-item-section.test.ts) - 16 subprocess-boundary tests for the GitHub adapter - 14 subprocess-boundary tests for the GitLab adapter - 10 integration tests for the handler (cross-platform dispatch + envelope) 48 new tests; full suite 2194 pass / 0 fail. Validate emits 76/76 tools registered including work_item_update. Closes #287
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
work_item_updateMCP tool to update existing GitHub/GitLab issues (title, body, body sections, labels, assignees, milestone). Mirrorswork_item(create) shape via the platform adapter pattern.Changes
handlers/work_item_update.ts— adapter-dispatching handler with zod validationlib/adapters/work-item-update-github.ts—gh issue editadapterlib/adapters/work-item-update-gitlab.ts—glab issue updateadapter (milestone returnsplatform_unsupported)lib/work-item-section.ts— H2 section splicing helperlib/adapters/types.tsPLATFORM_ADAPTER_METHODS and both adapter implementationsTests
./scripts/ci/validate.shgreen (76/76 tools registered)Notes
GitLab milestone updates return
platform_unsupported—glab issue update --milestonerequires numeric milestone id resolution that's out of scope. Same asymmetry pattern as #281.Closes #287