fix: Empty assignees array should clear assignees#2600
Open
RossTarrant wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue_write update semantics so that explicitly-provided empty assignees and/or labels arrays are treated as intentional “clear” operations (instead of being ignored as if omitted). This aligns tool behavior with the GitHub Issues API and resolves the inability to unassign everyone or remove all labels.
Changes:
- Track whether
assignees/labelswere explicitly present (and non-nil) inissue_writerequests. - Extend
UpdateIssuewith an options mechanism to include emptyassignees/labelsin PATCH requests when explicitly provided. - Add regression coverage for both the feature-flagged (
IssueWrite) and legacy (LegacyIssueWrite)issue_writeupdate handlers.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues.go | Detects explicit presence of assignees/labels and propagates that into UpdateIssue so empty arrays can clear values. |
| pkg/github/issues_test.go | Adds regression tests asserting PATCH request bodies include empty assignees/labels arrays for both flag-enabled and legacy paths. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
Comment on lines
+1796
to
+1799
| func issueWriteHasNonNilParam(args map[string]any, key string) bool { | ||
| value, ok := args[key] | ||
| return ok && value != nil | ||
| } |
Collaborator
There was a problem hiding this comment.
Seems a bit redundant to inline the helper.
It's both too specifically named for a generic operation and duplication to both the variants is also fine because in the end we will only be keeping one pathway.
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
Fixes
issue_writeupdates so explicitly emptyassigneesorlabelsarrays clear existing values instead of being ignored.Why
issue_writepreviously treated empty arrays the same as omitted parameters, making it impossible to unassign all users or remove all labels from an issue.Fixes #2596
What changed
assigneesandlabelswere explicitly provided inissue_writerequests.UpdateIssueviaUpdateIssueOptions.assignees/labelsarrays to the GitHub Issues API when explicitly provided.issue_writeupdate paths.MCP impact
issue_writeupdate behavior now honors explicitly emptyassigneesandlabelsarrays.Prompts tested (tool changes only)
reasonargument toget_mefunction #8 in rosstarrant/octopus-mcp"reasonargument toget_mefunction #8 in rosstarrant/octopus-mcp"Security / limits
Tool renaming
deprecated_tool_aliases.goLint & tests
./script/lint./script/testDocs