Add rationale and is_suggestion to granular assignee tool#2721
Open
alondahari wants to merge 1 commit into
Open
Add rationale and is_suggestion to granular assignee tool#2721alondahari wants to merge 1 commit into
alondahari wants to merge 1 commit into
Conversation
Update GranularUpdateIssueAssignees to accept polymorphic input where each assignee can be a plain string (login) or an object with login, rationale, confidence, and is_suggestion fields. This follows the same pattern already used by GranularUpdateIssueLabels. When any assignee includes rationale, confidence, or is_suggestion, the tool builds a custom request body with object-form assignees. Otherwise, it preserves the standard wire format with plain string arrays for backward compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the granular update_issue_assignees tool to accept polymorphic assignee inputs (either plain logins or structured objects carrying rationale/confidence/suggestion intent), matching the established “with intent” pattern already used by other granular issue update tools.
Changes:
- Updated
update_issue_assigneesinput schema to acceptoneOfassignee items:stringor{ login, rationale, confidence, is_suggestion }. - Implemented object-form request serialization when any assignee includes intent metadata, while preserving the legacy string-array wire format when not needed.
- Added expanded unit test coverage for mixed inputs, suggestions, rationale validation, and confidence normalization; updated the corresponding toolsnap and generated docs.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues_granular.go | Adds polymorphic assignee parsing + conditional request body shaping for intent metadata. |
| pkg/github/granular_tools_test.go | Adds/expands tests covering string/object assignees, suggestions, rationale validation, and confidence normalization. |
| pkg/github/toolsnaps/update_issue_assignees.snap | Updates the snapshot to reflect the new schema/description for update_issue_assignees. |
| docs/insiders-features.md | Regenerates docs with updated scope phrasing for ui_get. |
| docs/feature-flags.md | Regenerates docs reflecting the updated assignees tool schema and scope phrasing for ui_get. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
Comment on lines
+239
to
+241
| // GranularUpdateIssueAssignees creates a tool to update an issue's assignees. | ||
| // assigneeWithIntent represents the object form of an assignee entry, allowing a | ||
| // rationale, confidence level, and/or suggest flag to be sent alongside the login. |
Comment on lines
+249
to
+252
| // assigneesUpdateRequest is a custom request body for updating an issue's assignees | ||
| // where individual assignees may optionally include a rationale. Each element of | ||
| // Assignees is either a string (login) or an assigneeWithIntent object. | ||
| type assigneesUpdateRequest struct { |
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
Updates
GranularUpdateIssueAssigneesto support polymorphic input — each assignee can be a plain string (login) or an object withlogin,rationale,confidence, andis_suggestionfields. This follows the exact same pattern already established byGranularUpdateIssueLabels.Changes
assigneeWithIntentstruct — mirrorslabelWithIntentwithlogin,rationale,confidence, andsuggestfieldsassigneesUpdateRequeststruct — mirrorslabelsUpdateRequestfor custom request bodiesassigneesitems acceptoneOf: [string, object]with the object form supportinglogin,rationale,confidence, andis_suggestionclient.NewRequest+client.Do(bypassing the go-githubIssueRequest); otherwise preserves the standard string-array wire formatTests
TestGranularUpdateIssueAssignees— plain strings, object-without-rationale fallback, mixed,[]stringtyped arrayTestGranularUpdateIssueAssigneesSuggest— suggestion flag alone, with rationale, mixedTestGranularUpdateIssueAssigneesInvalidRationale— too-long rationale, missing loginTestGranularUpdateIssueAssigneesConfidence— confidence triggers object form, normalization, invalid valueFixes github/plan-track-agentic-toolkit#333