Add opt-in intent-aware Copilot issue assignment tool#2909
Conversation
Add `assign_copilot_to_issue_with_intent` in a new non-default toolset `copilot_issue_intents`. The tool uses GraphQL's object-form `assignees: [AssigneeUpdateInput!]` so intent metadata (rationale, confidence, is_suggestion) is attached to the Copilot entry only, while existing assignees are preserved. - Reuses the existing Copilot actor lookup, target-repository resolution, base_ref, custom_instructions, GraphQL-Features header, and direct-assignment PR polling behavior. - `is_suggestion: true` records a pending Copilot assignment intent, returns a suggestion-shaped result, and does not launch Copilot or poll for a linked PR. - `rationale` is capped at 280 characters (schema + runtime); `confidence` is validated against `LOW`/`MEDIUM`/`HIGH`. - Toolset is non-default so its inputs do not add schema bloat to the default tool surface; available via `copilot_issue_intents`, `all`, or explicit tool selection. Includes unit tests for direct assignment (with existing assignees and with base_ref/custom_instructions), the suggestion path, invalid rationale length, invalid confidence, and Copilot-not-available; a generated toolsnap; regenerated docs; and an e2e test for the suggestion path. Refs: github/plan-track-agentic-toolkit#683
There was a problem hiding this comment.
Pull request overview
Adds an opt-in tool for assigning or suggesting Copilot on issues with intent metadata.
Changes:
- Adds intent-aware direct and suggested assignment flows.
- Introduces the non-default
copilot_issue_intentstoolset. - Adds unit, snapshot, end-to-end, and generated documentation coverage.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents the toolset and tool. |
pkg/github/tools.go |
Registers the opt-in toolset and tool. |
pkg/github/copilot.go |
Implements intent-aware assignment behavior. |
pkg/github/copilot_test.go |
Tests schema, validation, and assignment paths. |
pkg/github/__toolsnaps__/assign_copilot_to_issue_with_intent.snap |
Captures the tool schema. |
e2e/e2e_test.go |
Tests suggested assignment end to end. |
docs/remote-server.md |
Documents remote toolset access. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 0
- Review effort level: Medium
| "readOnlyHint": false, | ||
| "title": "Assign Copilot to issue with intent" | ||
| }, | ||
| "description": "Assign Copilot to a specific issue with intent metadata attached to the assignment. When is_suggestion is true, a pending Copilot assignment intent is recorded rather than launching the agent; otherwise Copilot is directly assigned and begins work.\n\nThis tool can help with the following outcomes:\n- a Pull Request created with source code changes to resolve the issue (direct assignment)\n- a pending Copilot assignment suggestion is recorded on the issue for later approval (is_suggestion=true)\n\n\nMore information can be found at:\n- https://docs.github.com/en/copilot/using-github-copilot/using-copilot-coding-agent-to-work-on-tasks/about-assigning-tasks-to-copilot\n", |
There was a problem hiding this comment.
should we trim this description a bit? it's too verbose and repeats information, imo which adds to the schema bloat
There was a problem hiding this comment.
Maybe we can have an identical description to the assign_copilot_to_issue tool, and just add to it "prefer this tool over assign_copilot_to_issue when available"?
There was a problem hiding this comment.
Done — trimmed the description to mirror assign_copilot_to_issue with an appended "Prefer this tool over assign_copilot_to_issue when available" note. Removed the verbose is_suggestion narrative from the schema in bf2defd.
There was a problem hiding this comment.
Went with exactly this — description now matches assign_copilot_to_issue plus the preference note. See bf2defd.
| Description: "If true, records a pending Copilot assignment intent rather than launching the agent. Approval later supplies the launch context; base_ref and custom_instructions are ignored in this case.", | ||
| }, | ||
| }, | ||
| Required: []string{"owner", "repo", "issue_number"}, |
There was a problem hiding this comment.
should we require the intent fields?
There was a problem hiding this comment.
Done — rationale, confidence, and is_suggestion are now required in both the schema and at runtime. Added missing-field tests. is_suggestion is always sent explicitly on the Copilot AssigneeUpdateInput entry now. See bf2defd.
Per review feedback on #2909: - Trim the tool description to mirror assign_copilot_to_issue and add "Prefer this tool over assign_copilot_to_issue when available", removing the verbose is_suggestion narrative from the schema. - Make rationale, confidence, and is_suggestion required inputs (schema and runtime). is_suggestion is now always sent explicitly on the Copilot AssigneeUpdateInput entry. - Update unit tests to supply the newly-required fields and cover the missing-rationale and missing-confidence rejection paths. - Regenerate toolsnap and README.
Adds
assign_copilot_to_issue_with_intentin a new non-default toolsetcopilot_issue_intents. The tool uses GraphQL's object-formassignees: [AssigneeUpdateInput!]so intent metadata (rationale,confidence,is_suggestion) is attached to the Copilot entry only, while existing assignees are preserved.Refs: github/plan-track-agentic-toolkit#683
Design
assignees(extending our existingUpdateIssueInput) is used instead ofassigneeIds. The legacyassign_copilot_to_issuetool is unchanged; the new tool is opt-in.rationale,confidence,suggest) is set only on the Copilot entry. Preserved assignees are sent with justactorId.issues_copilot_assignment_api_supportis kept, along with the existingreposcope requirement.Behavior
is_suggestionunset orfalse): launches Copilot with the samebase_ref,custom_instructions, and PR-polling behavior asassign_copilot_to_issue.is_suggestion: true): records a pending Copilot assignment intent, returns a suggestion-shaped result, and does not launch Copilot or poll for a linked PR.base_refandcustom_instructionsare ignored in this case.rationalecapped at 280 characters (schema `maxLength` + runtime rune-count check);confidencerestricted to `LOW`/`MEDIUM`/`HIGH` (case-insensitive at runtime, uppercase-only in schema enum).Toolset
New non-default
copilot_issue_intentstoolset — available viaX-MCP-Tools/--toolsets copilot_issue_intents,all, or explicit tool selection. It is intentionally kept out of the default configuration so its inputs do not add schema bloat to the default tool surface, matching the guidance in the source issue.Acceptance criteria
Testing