-
Notifications
You must be signed in to change notification settings - Fork 36
Add usage example and pull request support to assign_to_agent tool #10041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
@copilot Should assign-to-agent not. have an option like assign-to-user? Is is assignable to both issues and PRs? |
Good catch! The
The Should I:
|
|
@copilot Does the api support PRs? |
Yes, the GitHub GraphQL API supports it. Both However, the current implementation only queries issues:
The REST API approach (used by |
|
@copilot Also add option for pull requests. |
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Added pull request support in commit d8bd867. The tool now accepts either Changes:
Usage examples: Both leverage the |
|
@copilot Update safe outputs docs. |
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Updated safe outputs documentation in commit 89655ca: Changes to
The documentation now accurately reflects that |
|
@copilot Playground: Assign to agent workflow to align with this to make sure it get's the issue number (since input is issue url). |
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Updated playground workflow in commit 8bb6202: Changes to
The workflow now properly guides the agent to extract the ID from the URL and call |
The
assign_to_agenttool description lacked a concrete usage example, potentially causing confusion about how to pass the requiredissue_numberparameter. Additionally, the tool only supported issues, not pull requests. The tool'sinputSchemawas correctly defined, but the description didn't demonstrate invocation syntax and the implementation needed PR support.Changes
Tool description enhancement: Added inline usage examples showing parameter syntax for both issues and PRs
assign_to_agent(issue_number=123, agent="copilot")andassign_to_agent(pull_number=456, agent="copilot")pkg/workflow/js/safe_outputs_tools.json(embedded) andactions/setup/js/safe_outputs_tools.json(runtime)Pull request support: Added full support for assigning agents to pull requests
getPullRequestDetails()function to query PR assignees via GraphQLrepository.pullRequest(number:)issue_numberandpull_numberparameters (mutually exclusive usingoneOf)Documentation updates: Updated safe outputs documentation to reflect PR support
issue_numberorpull_numberin the outputPlayground workflow updates: Updated the playground assign-to-agent workflow to support both issue and PR URLs
issue_urltoitem_urlto support both URL typesissue_numberorpull_number)Binary rebuild: Recompiled to embed updated tool schema
Workflow updates: Recompiled affected workflows to include enhanced tool description in lock files
Tests: Updated tests to match new error message format, all tests passing
The tool now clearly demonstrates how to invoke it with parameters for both issues and pull requests. Both leverage GitHub's GraphQL API where
IssueandPullRequesttypes implement theAssignableinterface, allowing the samereplaceActorsForAssignablemutation to work for both.Before:
{ "name": "assign_to_agent", "description": "Assign the GitHub Copilot coding agent to work on an issue. The agent will analyze the issue and attempt to implement a solution, creating a pull request when complete. Use this to delegate coding tasks to Copilot.", "inputSchema": { "type": "object", "required": ["issue_number"], "properties": { "issue_number": { ... }, "agent": { ... } } } }After:
{ "name": "assign_to_agent", "description": "Assign the GitHub Copilot coding agent to work on an issue or pull request. The agent will analyze the issue/PR and attempt to implement a solution, creating a pull request when complete. Use this to delegate coding tasks to Copilot. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\") or assign_to_agent(pull_number=456, agent=\"copilot\")", "inputSchema": { "type": "object", "oneOf": [ {"required": ["issue_number"]}, {"required": ["pull_number"]} ], "properties": { "issue_number": { ... }, "pull_number": { ... }, "agent": { ... } } } }Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.