Skip to content

Add rationale and is_suggestion to granular assignee tool#2721

Draft
alondahari wants to merge 1 commit into
mainfrom
alondahari/mcp-granular-assignee-rationale
Draft

Add rationale and is_suggestion to granular assignee tool#2721
alondahari wants to merge 1 commit into
mainfrom
alondahari/mcp-granular-assignee-rationale

Conversation

@alondahari

Copy link
Copy Markdown
Member

Summary

Updates GranularUpdateIssueAssignees to support polymorphic input — each assignee can be a plain string (login) or an object with login, rationale, confidence, and is_suggestion fields. This follows the exact same pattern already established by GranularUpdateIssueLabels.

Changes

  • assigneeWithIntent struct — mirrors labelWithIntent with login, rationale, confidence, and suggest fields
  • assigneesUpdateRequest struct — mirrors labelsUpdateRequest for custom request bodies
  • Polymorphic schemaassignees items accept oneOf: [string, object] with the object form supporting login, rationale, confidence, and is_suggestion
  • Custom request path — when any assignee has rationale/confidence/is_suggestion, builds object-form JSON via client.NewRequest + client.Do (bypassing the go-github IssueRequest); otherwise preserves the standard string-array wire format
  • Backward compatible — plain string arrays continue to work identically

Tests

  • TestGranularUpdateIssueAssignees — plain strings, object-without-rationale fallback, mixed, []string typed array
  • TestGranularUpdateIssueAssigneesSuggest — suggestion flag alone, with rationale, mixed
  • TestGranularUpdateIssueAssigneesInvalidRationale — too-long rationale, missing login
  • TestGranularUpdateIssueAssigneesConfidence — confidence triggers object form, normalization, invalid value

Fixes github/plan-track-agentic-toolkit#333

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>
@alondahari alondahari requested a review from a team as a code owner June 17, 2026 16:47
Copilot AI review requested due to automatic review settings June 17, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_assignees input schema to accept oneOf assignee items: string or { 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 {
@alondahari alondahari marked this pull request as draft June 18, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants