Skip to content

Add is_suggestion + rationale to update_issue_assignees#2821

Open
kelsey-myers wants to merge 2 commits into
mainfrom
km/granular-assignees-intent
Open

Add is_suggestion + rationale to update_issue_assignees#2821
kelsey-myers wants to merge 2 commits into
mainfrom
km/granular-assignees-intent

Conversation

@kelsey-myers

@kelsey-myers kelsey-myers commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds is_suggestion + rationale (and confidence) params to the granular update_issue_assignees MCP tool, so agents can propose assignees as pending suggestions rather than applying them directly.

Why

Closes https://github.com/github/plan-track-agentic-toolkit/issues/333

The other granular tools (update_issue_type, update_issue_labels, set_issue_fields) already support intent params behind the issues_granular feature flag. update_issue_assignees was the last granular tool still on the plain string-array form. This brings it to parity, following the same implementation pattern as the labels tool in #2557.

image

What changed

  • Reworked GranularUpdateIssueAssignees from the simple issueUpdateTool wrapper to the object-form pattern: assignees items are now oneOf: [string, object], where the object is { login (required), rationale (≤280 chars), confidence (low/medium/high), is_suggestion }.
  • Handler parses string-or-object entries, validates rationale length and confidence enum, and sends either the plain IssueRequest{Assignees:} (no intent) or an object-form body ({ login, rationale, confidence, suggest }) via a raw PATCH — mirroring update_issue_labels.
  • Added assigneeWithIntent and assigneesUpdateRequest structs.
  • Regenerated the tool snapshot and docs/feature-flags.md.
  • Added integration tests: object-form (plain / suggest / rationale+confidence / mixed) and validation errors (rationale too long, missing login, invalid confidence).

MCP impact

  • Tool schema or behavior changed — update_issue_assignees now accepts an object form per assignee with rationale / confidence / is_suggestion. The plain string-array form is unchanged and still serializes identically, so it's backwards compatible.

Prompts tested (tool changes only)

Tested locally against dotcom via a local build (bin/github-mcp-server-local, --features issues_granular):

  • Suggest an assignee with rationale + high confidence → issue returned, assignee not applied (pending suggestion created), confirmed via the API.
  • Invalid confidence value → tool error confidence must be one of: low, medium, high.
  • Malformed entry (123) → tool error each assignee must be a string or an object….
  • Empty assignees array → clean no-op.
  • Non-assignable login with is_suggestion: true → dotcom 422 surfaced as a clean tool error.

Security / limits

  • No security or limits impact — same auth/scopes (repo) and endpoint as before; only the request-body shape gained optional intent fields. Rationale is capped at 280 chars.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Updated (README / docs / examples) — regenerated via script/generate-docs.

@kelsey-myers kelsey-myers marked this pull request as ready for review July 6, 2026 09:19
@kelsey-myers kelsey-myers requested a review from a team as a code owner July 6, 2026 09:19
Copilot AI review requested due to automatic review settings July 6, 2026 09:19
@Trustinbtc999-hue

This comment was marked as spam.

Trustinbtc999-hue

This comment was marked as spam.

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 updates the issues_granular feature-flagged MCP tool update_issue_assignees to support an “intent” object form per assignee (including is_suggestion, rationale, and confidence), bringing it in line with the object-form patterns already used by other granular issue update tools.

Changes:

  • Replaces the previous issueUpdateTool wrapper for update_issue_assignees with a custom handler that accepts assignees items as string | { login, rationale?, confidence?, is_suggestion? }.
  • Adds request-shaping logic to preserve the legacy wire format when no intent fields are used, and switches to an object-form PATCH body when intent fields are present.
  • Updates the tool snapshot and adds unit tests for object-form serialization and validation errors.
Show a summary per file
File Description
pkg/github/issues_granular.go Reworks update_issue_assignees schema + handler to support per-assignee intent fields and object-form requests.
pkg/github/granular_tools_test.go Adds tests for the new object-form behavior and validation paths.
pkg/github/toolsnaps/update_issue_assignees.snap Updates the snapshot to reflect the new assignees oneOf schema.
docs/feature-flags.md Regenerates feature-flag tool parameter docs for update_issue_assignees.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread pkg/github/issues_granular.go
Comment thread pkg/github/granular_tools_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants