From 4089eacc99fe11d03dd6b181191d085e404ce897 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:07:14 +0000 Subject: [PATCH 1/6] Initial plan From a469a66d66c02eb9b09898289f07efee400d2d5e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:19:26 +0000 Subject: [PATCH 2/6] Enhance assign_to_agent tool description with usage example Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .github/workflows/campaign-generator.lock.yml | 2 +- .../playground-assign-to-agent.lock.yml | 2 +- actions/setup/js/safe_outputs_tools.json | 269 ++++++++++++++---- pkg/workflow/js/safe_outputs_tools.json | 2 +- 4 files changed, 218 insertions(+), 57 deletions(-) diff --git a/.github/workflows/campaign-generator.lock.yml b/.github/workflows/campaign-generator.lock.yml index 97b0088501f..b8e0eddeec4 100644 --- a/.github/workflows/campaign-generator.lock.yml +++ b/.github/workflows/campaign-generator.lock.yml @@ -230,7 +230,7 @@ jobs: "name": "add_comment" }, { - "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.", + "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", "inputSchema": { "additionalProperties": false, "properties": { diff --git a/.github/workflows/playground-assign-to-agent.lock.yml b/.github/workflows/playground-assign-to-agent.lock.yml index 46bd4268106..273a43c36da 100644 --- a/.github/workflows/playground-assign-to-agent.lock.yml +++ b/.github/workflows/playground-assign-to-agent.lock.yml @@ -178,7 +178,7 @@ jobs: cat > /opt/gh-aw/safeoutputs/tools.json << 'EOF' [ { - "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. CONSTRAINTS: Maximum 1 issue(s) can be assigned 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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\") CONSTRAINTS: Maximum 1 issue(s) can be assigned to agent.", "inputSchema": { "additionalProperties": false, "properties": { diff --git a/actions/setup/js/safe_outputs_tools.json b/actions/setup/js/safe_outputs_tools.json index df900b4e211..e34e3b89efa 100644 --- a/actions/setup/js/safe_outputs_tools.json +++ b/actions/setup/js/safe_outputs_tools.json @@ -4,7 +4,10 @@ "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead.", "inputSchema": { "type": "object", - "required": ["title", "body"], + "required": [ + "title", + "body" + ], "properties": { "title": { "type": "string", @@ -22,7 +25,10 @@ "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository." }, "parent": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Parent issue number for creating sub-issues. This is the numeric ID from the GitHub URL (e.g., 42 in github.com/owner/repo/issues/42). Can also be a temporary_id (e.g., 'aw_abc123def456') from a previously created issue in the same workflow run." }, "temporary_id": { @@ -38,7 +44,9 @@ "description": "Create a GitHub Copilot agent session to delegate coding work. Use this when you need another Copilot agent to implement code changes, fix bugs, or complete development tasks. The task becomes a new issue that triggers the Copilot coding agent. For non-coding tasks or manual work items, use create_issue instead.", "inputSchema": { "type": "object", - "required": ["body"], + "required": [ + "body" + ], "properties": { "body": { "type": "string", @@ -53,7 +61,10 @@ "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead.", "inputSchema": { "type": "object", - "required": ["title", "body"], + "required": [ + "title", + "body" + ], "properties": { "title": { "type": "string", @@ -86,7 +97,10 @@ "description": "New discussion body to replace the existing content. Use Markdown formatting." }, "discussion_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Discussion number to update. This is the numeric ID from the GitHub URL (e.g., 345 in github.com/owner/repo/discussions/345). Required when the workflow target is '*' (any discussion)." } }, @@ -98,7 +112,9 @@ "description": "Close a GitHub discussion with a resolution comment and optional reason. Use this to mark discussions as resolved, answered, or no longer needed. The closing comment should explain why the discussion is being closed.", "inputSchema": { "type": "object", - "required": ["body"], + "required": [ + "body" + ], "properties": { "body": { "type": "string", @@ -106,11 +122,19 @@ }, "reason": { "type": "string", - "enum": ["RESOLVED", "DUPLICATE", "OUTDATED", "ANSWERED"], + "enum": [ + "RESOLVED", + "DUPLICATE", + "OUTDATED", + "ANSWERED" + ], "description": "Resolution reason: RESOLVED (issue addressed), DUPLICATE (discussed elsewhere), OUTDATED (no longer relevant), or ANSWERED (question answered)." }, "discussion_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Discussion number to close. This is the numeric ID from the GitHub URL (e.g., 678 in github.com/owner/repo/discussions/678). If omitted, closes the discussion that triggered this workflow (requires a discussion event trigger)." } }, @@ -122,14 +146,19 @@ "description": "Close a GitHub issue with a closing comment. Use this when work is complete, the issue is no longer relevant, or it's a duplicate. The closing comment should explain the resolution or reason for closing.", "inputSchema": { "type": "object", - "required": ["body"], + "required": [ + "body" + ], "properties": { "body": { "type": "string", "description": "Closing comment explaining why the issue is being closed and summarizing any resolution, workaround, or conclusion." }, "issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Issue number to close. This is the numeric ID from the GitHub URL (e.g., 901 in github.com/owner/repo/issues/901). If omitted, closes the issue that triggered this workflow (requires an issue event trigger)." } }, @@ -141,14 +170,19 @@ "description": "Close a pull request WITHOUT merging, adding a closing comment. Use this for PRs that should be abandoned, superseded, or closed for other reasons. The closing comment should explain why the PR is being closed. This does NOT merge the changes.", "inputSchema": { "type": "object", - "required": ["body"], + "required": [ + "body" + ], "properties": { "body": { "type": "string", "description": "Closing comment explaining why the PR is being closed without merging (e.g., superseded by another PR, no longer needed, approach rejected)." }, "pull_request_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Pull request number to close. This is the numeric ID from the GitHub URL (e.g., 432 in github.com/owner/repo/pull/432). If omitted, closes the PR that triggered this workflow (requires a pull_request event trigger)." } }, @@ -160,7 +194,9 @@ "description": "Add a comment to an existing GitHub issue, pull request, or discussion. Use this to provide feedback, answer questions, or add information to an existing conversation. For creating new items, use create_issue, create_discussion, or create_pull_request instead.", "inputSchema": { "type": "object", - "required": ["body"], + "required": [ + "body" + ], "properties": { "body": { "type": "string", @@ -179,7 +215,10 @@ "description": "Create a new GitHub pull request to propose code changes. Use this after making file edits to submit them for review and merging. The PR will be created from the current branch with your committed changes. For code review comments on an existing PR, use create_pull_request_review_comment instead.", "inputSchema": { "type": "object", - "required": ["title", "body"], + "required": [ + "title", + "body" + ], "properties": { "title": { "type": "string", @@ -209,14 +248,21 @@ "description": "Create a review comment on a specific line of code in a pull request. Use this for inline code review feedback, suggestions, or questions about specific code changes. For general PR comments not tied to specific lines, use add_comment instead.", "inputSchema": { "type": "object", - "required": ["path", "line", "body"], + "required": [ + "path", + "line", + "body" + ], "properties": { "path": { "type": "string", "description": "File path relative to the repository root (e.g., 'src/auth/login.js'). Must be a file that was changed in the PR." }, "line": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Line number for the comment. For single-line comments, this is the target line. For multi-line comments, this is the ending line." }, "body": { @@ -224,12 +270,18 @@ "description": "Review comment content in Markdown. Provide specific, actionable feedback about the code at this location." }, "start_line": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Starting line number for multi-line comments. When set, the comment spans from start_line to line. Omit for single-line comments." }, "side": { "type": "string", - "enum": ["LEFT", "RIGHT"], + "enum": [ + "LEFT", + "RIGHT" + ], "description": "Side of the diff to comment on: RIGHT for the new version (additions), LEFT for the old version (deletions). Defaults to RIGHT." } }, @@ -241,19 +293,32 @@ "description": "Create a code scanning alert for security vulnerabilities, code quality issues, or other findings. Alerts appear in the repository's Security tab and integrate with GitHub's security features. Use this for automated security analysis results.", "inputSchema": { "type": "object", - "required": ["file", "line", "severity", "message"], + "required": [ + "file", + "line", + "severity", + "message" + ], "properties": { "file": { "type": "string", "description": "File path relative to the repository root where the issue was found (e.g., 'src/auth/password.js')." }, "line": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Line number where the issue was found in the file." }, "severity": { "type": "string", - "enum": ["error", "warning", "info", "note"], + "enum": [ + "error", + "warning", + "info", + "note" + ], "description": "Alert severity level: 'error' (critical security issues), 'warning' (potential problems), 'info' (informational), or 'note' (minor observations)." }, "message": { @@ -261,7 +326,10 @@ "description": "Clear description of the security issue or finding. Include what's wrong and ideally how to fix it." }, "column": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Column number for more precise location of the issue within the line." }, "ruleIdSuffix": { @@ -277,7 +345,9 @@ "description": "Add labels to an existing GitHub issue or pull request for categorization and filtering. Labels must already exist in the repository. For creating new issues with labels, use create_issue with the labels property instead.", "inputSchema": { "type": "object", - "required": ["labels"], + "required": [ + "labels" + ], "properties": { "labels": { "type": "array", @@ -299,7 +369,9 @@ "description": "Add reviewers to a GitHub pull request. Reviewers receive notifications and can approve or request changes. Use 'copilot' as a reviewer name to request the Copilot PR review bot.", "inputSchema": { "type": "object", - "required": ["reviewers"], + "required": [ + "reviewers" + ], "properties": { "reviewers": { "type": "array", @@ -309,7 +381,10 @@ "description": "GitHub usernames to add as reviewers (e.g., ['octocat', 'copilot']). Users must have access to the repository." }, "pull_request_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Pull request number to add reviewers to. This is the numeric ID from the GitHub URL (e.g., 876 in github.com/owner/repo/pull/876). If omitted, adds reviewers to the PR that triggered this workflow." } }, @@ -321,14 +396,23 @@ "description": "Assign an issue to a milestone for release planning and progress tracking. Milestones must exist in the repository before assignment.", "inputSchema": { "type": "object", - "required": ["issue_number", "milestone_number"], + "required": [ + "issue_number", + "milestone_number" + ], "properties": { "issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Issue number to assign to the milestone. This is the numeric ID from the GitHub URL (e.g., 567 in github.com/owner/repo/issues/567)." }, "milestone_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Milestone number (not title) to assign the issue to. This is the numeric ID from the milestone URL (e.g., 12 in github.com/owner/repo/milestone/12). Find milestone numbers in the repository's Milestones page." } }, @@ -337,13 +421,18 @@ }, { "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.", + "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", "inputSchema": { "type": "object", - "required": ["issue_number"], + "required": [ + "issue_number" + ], "properties": { "issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements." }, "agent": { @@ -359,10 +448,15 @@ "description": "Assign one or more GitHub users to an issue. Use this to delegate work to specific team members. Users must have access to the repository.", "inputSchema": { "type": "object", - "required": ["issue_number"], + "required": [ + "issue_number" + ], "properties": { "issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Issue number to assign users to. This is the numeric ID from the GitHub URL (e.g., 543 in github.com/owner/repo/issues/543). If omitted, assigns to the issue that triggered this workflow." }, "assignees": { @@ -388,7 +482,10 @@ "properties": { "status": { "type": "string", - "enum": ["open", "closed"], + "enum": [ + "open", + "closed" + ], "description": "New issue status: 'open' to reopen a closed issue, 'closed' to close an open issue." }, "title": { @@ -400,7 +497,10 @@ "description": "New issue body to replace the existing content. Use Markdown formatting." }, "issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Issue number to update. This is the numeric ID from the GitHub URL (e.g., 789 in github.com/owner/repo/issues/789). Required when the workflow target is '*' (any issue)." } }, @@ -423,11 +523,18 @@ }, "operation": { "type": "string", - "enum": ["replace", "append", "prepend"], + "enum": [ + "replace", + "append", + "prepend" + ], "description": "How to update the PR body: 'replace' (default - completely overwrite), 'append' (add to end with separator), or 'prepend' (add to start with separator). Title is always replaced." }, "pull_request_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Pull request number to update. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/pull/234). Required when the workflow target is '*' (any PR)." } }, @@ -439,7 +546,9 @@ "description": "Push committed changes to a pull request's branch. Use this to add follow-up commits to an existing PR, such as addressing review feedback or fixing issues. Changes must be committed locally before calling this tool.", "inputSchema": { "type": "object", - "required": ["message"], + "required": [ + "message" + ], "properties": { "branch": { "type": "string", @@ -450,7 +559,10 @@ "description": "Commit message describing the changes. Follow repository commit message conventions (e.g., conventional commits)." }, "pull_request_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "Pull request number to push changes to. This is the numeric ID from the GitHub URL (e.g., 654 in github.com/owner/repo/pull/654). Required when the workflow target is '*' (any PR)." } }, @@ -462,7 +574,9 @@ "description": "Upload a file as a URL-addressable asset that can be referenced in issues, PRs, or comments. The file is stored on an orphaned git branch and returns a permanent URL. Use this for images, diagrams, or other files that need to be embedded in GitHub content.", "inputSchema": { "type": "object", - "required": ["path"], + "required": [ + "path" + ], "properties": { "path": { "type": "string", @@ -477,7 +591,11 @@ "description": "Update a GitHub release description by replacing, appending to, or prepending to the existing content. Use this to add release notes, changelogs, or additional information to an existing release.", "inputSchema": { "type": "object", - "required": ["tag", "operation", "body"], + "required": [ + "tag", + "operation", + "body" + ], "properties": { "tag": { "type": "string", @@ -485,7 +603,11 @@ }, "operation": { "type": "string", - "enum": ["replace", "append", "prepend"], + "enum": [ + "replace", + "append", + "prepend" + ], "description": "How to update the release body: 'replace' (completely overwrite), 'append' (add to end with separator), or 'prepend' (add to start with separator)." }, "body": { @@ -501,7 +623,9 @@ "description": "Report that a tool or capability needed to complete the task is not available, or share any information you deem important about missing functionality or limitations. Use this when you cannot accomplish what was requested because the required functionality is missing or access is restricted.", "inputSchema": { "type": "object", - "required": ["reason"], + "required": [ + "reason" + ], "properties": { "tool": { "type": "string", @@ -524,7 +648,9 @@ "description": "Log a transparency message when no significant actions are needed. Use this to confirm workflow completion and provide visibility when analysis is complete but no changes or outputs are required (e.g., 'No issues found', 'All checks passed'). This ensures the workflow produces human-visible output even when no other actions are taken.", "inputSchema": { "type": "object", - "required": ["message"], + "required": [ + "message" + ], "properties": { "message": { "type": "string", @@ -539,14 +665,23 @@ "description": "Link an issue as a sub-issue of a parent issue. Use this to establish parent-child relationships between issues for better organization and tracking of related work items.", "inputSchema": { "type": "object", - "required": ["parent_issue_number", "sub_issue_number"], + "required": [ + "parent_issue_number", + "sub_issue_number" + ], "properties": { "parent_issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "The parent issue number to link the sub-issue to. This is the numeric ID from the GitHub URL (e.g., 100 in github.com/owner/repo/issues/100)." }, "sub_issue_number": { - "type": ["number", "string"], + "type": [ + "number", + "string" + ], "description": "The issue number to link as a sub-issue of the parent. This is the numeric ID from the GitHub URL (e.g., 101 in github.com/owner/repo/issues/101)." } }, @@ -558,7 +693,9 @@ "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, or resolved. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID.", "inputSchema": { "type": "object", - "required": ["comment_id"], + "required": [ + "comment_id" + ], "properties": { "comment_id": { "type": "string", @@ -566,7 +703,13 @@ }, "reason": { "type": "string", - "enum": ["SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED"], + "enum": [ + "SPAM", + "ABUSE", + "OFF_TOPIC", + "OUTDATED", + "RESOLVED" + ], "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved)." } }, @@ -586,7 +729,11 @@ }, "content_type": { "type": "string", - "enum": ["issue", "pull_request", "draft_issue"], + "enum": [ + "issue", + "pull_request", + "draft_issue" + ], "description": "Type of item to add to the project. Use 'issue' or 'pull_request' to add existing repo content, or 'draft_issue' to create a draft item inside the project." }, "content_number": { @@ -616,15 +763,26 @@ }, "oneOf": [ { - "required": ["project", "content_type", "content_number"], + "required": [ + "project", + "content_type", + "content_number" + ], "properties": { "content_type": { - "enum": ["issue", "pull_request"] + "enum": [ + "issue", + "pull_request" + ] } } }, { - "required": ["project", "content_type", "draft_title"], + "required": [ + "project", + "content_type", + "draft_title" + ], "properties": { "content_type": { "const": "draft_issue" @@ -640,7 +798,10 @@ "description": "Report that data or information needed to complete the task is not available. Use this when you cannot accomplish what was requested because required data, context, or information is missing.", "inputSchema": { "type": "object", - "required": ["data_type", "reason"], + "required": [ + "data_type", + "reason" + ], "properties": { "data_type": { "type": "string", diff --git a/pkg/workflow/js/safe_outputs_tools.json b/pkg/workflow/js/safe_outputs_tools.json index bd0d42ee1ac..fc9fcd9d75d 100644 --- a/pkg/workflow/js/safe_outputs_tools.json +++ b/pkg/workflow/js/safe_outputs_tools.json @@ -489,7 +489,7 @@ }, { "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.", + "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", "inputSchema": { "type": "object", "required": [ From b2875826e5728667da262438088dca8ff042e601 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:25:52 +0000 Subject: [PATCH 3/6] Complete assign_to_agent enhancement - all tests passing Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .github/workflows/issue-monster.lock.yml | 2 +- .github/workflows/workflow-generator.lock.yml | 2 +- actions/setup/js/safe_outputs_tools.json | 267 ++++-------------- 3 files changed, 55 insertions(+), 216 deletions(-) diff --git a/.github/workflows/issue-monster.lock.yml b/.github/workflows/issue-monster.lock.yml index 6dc57f2e540..b52fee08e99 100644 --- a/.github/workflows/issue-monster.lock.yml +++ b/.github/workflows/issue-monster.lock.yml @@ -209,7 +209,7 @@ jobs: "name": "add_comment" }, { - "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. CONSTRAINTS: Maximum 3 issue(s) can be assigned 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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\") CONSTRAINTS: Maximum 3 issue(s) can be assigned to agent.", "inputSchema": { "additionalProperties": false, "properties": { diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index e99ffce9521..387d8cb6a88 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -208,7 +208,7 @@ jobs: cat > /opt/gh-aw/safeoutputs/tools.json << 'EOF' [ { - "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.", + "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", "inputSchema": { "additionalProperties": false, "properties": { diff --git a/actions/setup/js/safe_outputs_tools.json b/actions/setup/js/safe_outputs_tools.json index e34e3b89efa..6687abfbb90 100644 --- a/actions/setup/js/safe_outputs_tools.json +++ b/actions/setup/js/safe_outputs_tools.json @@ -4,10 +4,7 @@ "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead.", "inputSchema": { "type": "object", - "required": [ - "title", - "body" - ], + "required": ["title", "body"], "properties": { "title": { "type": "string", @@ -25,10 +22,7 @@ "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository." }, "parent": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Parent issue number for creating sub-issues. This is the numeric ID from the GitHub URL (e.g., 42 in github.com/owner/repo/issues/42). Can also be a temporary_id (e.g., 'aw_abc123def456') from a previously created issue in the same workflow run." }, "temporary_id": { @@ -44,9 +38,7 @@ "description": "Create a GitHub Copilot agent session to delegate coding work. Use this when you need another Copilot agent to implement code changes, fix bugs, or complete development tasks. The task becomes a new issue that triggers the Copilot coding agent. For non-coding tasks or manual work items, use create_issue instead.", "inputSchema": { "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": { "type": "string", @@ -61,10 +53,7 @@ "description": "Create a GitHub discussion for announcements, Q&A, reports, status updates, or community conversations. Use this for content that benefits from threaded replies, doesn't require task tracking, or serves as documentation. For actionable work items that need assignment and status tracking, use create_issue instead.", "inputSchema": { "type": "object", - "required": [ - "title", - "body" - ], + "required": ["title", "body"], "properties": { "title": { "type": "string", @@ -97,10 +86,7 @@ "description": "New discussion body to replace the existing content. Use Markdown formatting." }, "discussion_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Discussion number to update. This is the numeric ID from the GitHub URL (e.g., 345 in github.com/owner/repo/discussions/345). Required when the workflow target is '*' (any discussion)." } }, @@ -112,9 +98,7 @@ "description": "Close a GitHub discussion with a resolution comment and optional reason. Use this to mark discussions as resolved, answered, or no longer needed. The closing comment should explain why the discussion is being closed.", "inputSchema": { "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": { "type": "string", @@ -122,19 +106,11 @@ }, "reason": { "type": "string", - "enum": [ - "RESOLVED", - "DUPLICATE", - "OUTDATED", - "ANSWERED" - ], + "enum": ["RESOLVED", "DUPLICATE", "OUTDATED", "ANSWERED"], "description": "Resolution reason: RESOLVED (issue addressed), DUPLICATE (discussed elsewhere), OUTDATED (no longer relevant), or ANSWERED (question answered)." }, "discussion_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Discussion number to close. This is the numeric ID from the GitHub URL (e.g., 678 in github.com/owner/repo/discussions/678). If omitted, closes the discussion that triggered this workflow (requires a discussion event trigger)." } }, @@ -146,19 +122,14 @@ "description": "Close a GitHub issue with a closing comment. Use this when work is complete, the issue is no longer relevant, or it's a duplicate. The closing comment should explain the resolution or reason for closing.", "inputSchema": { "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": { "type": "string", "description": "Closing comment explaining why the issue is being closed and summarizing any resolution, workaround, or conclusion." }, "issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Issue number to close. This is the numeric ID from the GitHub URL (e.g., 901 in github.com/owner/repo/issues/901). If omitted, closes the issue that triggered this workflow (requires an issue event trigger)." } }, @@ -170,19 +141,14 @@ "description": "Close a pull request WITHOUT merging, adding a closing comment. Use this for PRs that should be abandoned, superseded, or closed for other reasons. The closing comment should explain why the PR is being closed. This does NOT merge the changes.", "inputSchema": { "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": { "type": "string", "description": "Closing comment explaining why the PR is being closed without merging (e.g., superseded by another PR, no longer needed, approach rejected)." }, "pull_request_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Pull request number to close. This is the numeric ID from the GitHub URL (e.g., 432 in github.com/owner/repo/pull/432). If omitted, closes the PR that triggered this workflow (requires a pull_request event trigger)." } }, @@ -194,9 +160,7 @@ "description": "Add a comment to an existing GitHub issue, pull request, or discussion. Use this to provide feedback, answer questions, or add information to an existing conversation. For creating new items, use create_issue, create_discussion, or create_pull_request instead.", "inputSchema": { "type": "object", - "required": [ - "body" - ], + "required": ["body"], "properties": { "body": { "type": "string", @@ -215,10 +179,7 @@ "description": "Create a new GitHub pull request to propose code changes. Use this after making file edits to submit them for review and merging. The PR will be created from the current branch with your committed changes. For code review comments on an existing PR, use create_pull_request_review_comment instead.", "inputSchema": { "type": "object", - "required": [ - "title", - "body" - ], + "required": ["title", "body"], "properties": { "title": { "type": "string", @@ -248,21 +209,14 @@ "description": "Create a review comment on a specific line of code in a pull request. Use this for inline code review feedback, suggestions, or questions about specific code changes. For general PR comments not tied to specific lines, use add_comment instead.", "inputSchema": { "type": "object", - "required": [ - "path", - "line", - "body" - ], + "required": ["path", "line", "body"], "properties": { "path": { "type": "string", "description": "File path relative to the repository root (e.g., 'src/auth/login.js'). Must be a file that was changed in the PR." }, "line": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Line number for the comment. For single-line comments, this is the target line. For multi-line comments, this is the ending line." }, "body": { @@ -270,18 +224,12 @@ "description": "Review comment content in Markdown. Provide specific, actionable feedback about the code at this location." }, "start_line": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Starting line number for multi-line comments. When set, the comment spans from start_line to line. Omit for single-line comments." }, "side": { "type": "string", - "enum": [ - "LEFT", - "RIGHT" - ], + "enum": ["LEFT", "RIGHT"], "description": "Side of the diff to comment on: RIGHT for the new version (additions), LEFT for the old version (deletions). Defaults to RIGHT." } }, @@ -293,32 +241,19 @@ "description": "Create a code scanning alert for security vulnerabilities, code quality issues, or other findings. Alerts appear in the repository's Security tab and integrate with GitHub's security features. Use this for automated security analysis results.", "inputSchema": { "type": "object", - "required": [ - "file", - "line", - "severity", - "message" - ], + "required": ["file", "line", "severity", "message"], "properties": { "file": { "type": "string", "description": "File path relative to the repository root where the issue was found (e.g., 'src/auth/password.js')." }, "line": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Line number where the issue was found in the file." }, "severity": { "type": "string", - "enum": [ - "error", - "warning", - "info", - "note" - ], + "enum": ["error", "warning", "info", "note"], "description": "Alert severity level: 'error' (critical security issues), 'warning' (potential problems), 'info' (informational), or 'note' (minor observations)." }, "message": { @@ -326,10 +261,7 @@ "description": "Clear description of the security issue or finding. Include what's wrong and ideally how to fix it." }, "column": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Column number for more precise location of the issue within the line." }, "ruleIdSuffix": { @@ -345,9 +277,7 @@ "description": "Add labels to an existing GitHub issue or pull request for categorization and filtering. Labels must already exist in the repository. For creating new issues with labels, use create_issue with the labels property instead.", "inputSchema": { "type": "object", - "required": [ - "labels" - ], + "required": ["labels"], "properties": { "labels": { "type": "array", @@ -369,9 +299,7 @@ "description": "Add reviewers to a GitHub pull request. Reviewers receive notifications and can approve or request changes. Use 'copilot' as a reviewer name to request the Copilot PR review bot.", "inputSchema": { "type": "object", - "required": [ - "reviewers" - ], + "required": ["reviewers"], "properties": { "reviewers": { "type": "array", @@ -381,10 +309,7 @@ "description": "GitHub usernames to add as reviewers (e.g., ['octocat', 'copilot']). Users must have access to the repository." }, "pull_request_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Pull request number to add reviewers to. This is the numeric ID from the GitHub URL (e.g., 876 in github.com/owner/repo/pull/876). If omitted, adds reviewers to the PR that triggered this workflow." } }, @@ -396,23 +321,14 @@ "description": "Assign an issue to a milestone for release planning and progress tracking. Milestones must exist in the repository before assignment.", "inputSchema": { "type": "object", - "required": [ - "issue_number", - "milestone_number" - ], + "required": ["issue_number", "milestone_number"], "properties": { "issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Issue number to assign to the milestone. This is the numeric ID from the GitHub URL (e.g., 567 in github.com/owner/repo/issues/567)." }, "milestone_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Milestone number (not title) to assign the issue to. This is the numeric ID from the milestone URL (e.g., 12 in github.com/owner/repo/milestone/12). Find milestone numbers in the repository's Milestones page." } }, @@ -424,15 +340,10 @@ "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", "inputSchema": { "type": "object", - "required": [ - "issue_number" - ], + "required": ["issue_number"], "properties": { "issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements." }, "agent": { @@ -448,15 +359,10 @@ "description": "Assign one or more GitHub users to an issue. Use this to delegate work to specific team members. Users must have access to the repository.", "inputSchema": { "type": "object", - "required": [ - "issue_number" - ], + "required": ["issue_number"], "properties": { "issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Issue number to assign users to. This is the numeric ID from the GitHub URL (e.g., 543 in github.com/owner/repo/issues/543). If omitted, assigns to the issue that triggered this workflow." }, "assignees": { @@ -482,10 +388,7 @@ "properties": { "status": { "type": "string", - "enum": [ - "open", - "closed" - ], + "enum": ["open", "closed"], "description": "New issue status: 'open' to reopen a closed issue, 'closed' to close an open issue." }, "title": { @@ -497,10 +400,7 @@ "description": "New issue body to replace the existing content. Use Markdown formatting." }, "issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Issue number to update. This is the numeric ID from the GitHub URL (e.g., 789 in github.com/owner/repo/issues/789). Required when the workflow target is '*' (any issue)." } }, @@ -523,18 +423,11 @@ }, "operation": { "type": "string", - "enum": [ - "replace", - "append", - "prepend" - ], + "enum": ["replace", "append", "prepend"], "description": "How to update the PR body: 'replace' (default - completely overwrite), 'append' (add to end with separator), or 'prepend' (add to start with separator). Title is always replaced." }, "pull_request_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Pull request number to update. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/pull/234). Required when the workflow target is '*' (any PR)." } }, @@ -546,9 +439,7 @@ "description": "Push committed changes to a pull request's branch. Use this to add follow-up commits to an existing PR, such as addressing review feedback or fixing issues. Changes must be committed locally before calling this tool.", "inputSchema": { "type": "object", - "required": [ - "message" - ], + "required": ["message"], "properties": { "branch": { "type": "string", @@ -559,10 +450,7 @@ "description": "Commit message describing the changes. Follow repository commit message conventions (e.g., conventional commits)." }, "pull_request_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "Pull request number to push changes to. This is the numeric ID from the GitHub URL (e.g., 654 in github.com/owner/repo/pull/654). Required when the workflow target is '*' (any PR)." } }, @@ -574,9 +462,7 @@ "description": "Upload a file as a URL-addressable asset that can be referenced in issues, PRs, or comments. The file is stored on an orphaned git branch and returns a permanent URL. Use this for images, diagrams, or other files that need to be embedded in GitHub content.", "inputSchema": { "type": "object", - "required": [ - "path" - ], + "required": ["path"], "properties": { "path": { "type": "string", @@ -591,11 +477,7 @@ "description": "Update a GitHub release description by replacing, appending to, or prepending to the existing content. Use this to add release notes, changelogs, or additional information to an existing release.", "inputSchema": { "type": "object", - "required": [ - "tag", - "operation", - "body" - ], + "required": ["tag", "operation", "body"], "properties": { "tag": { "type": "string", @@ -603,11 +485,7 @@ }, "operation": { "type": "string", - "enum": [ - "replace", - "append", - "prepend" - ], + "enum": ["replace", "append", "prepend"], "description": "How to update the release body: 'replace' (completely overwrite), 'append' (add to end with separator), or 'prepend' (add to start with separator)." }, "body": { @@ -623,9 +501,7 @@ "description": "Report that a tool or capability needed to complete the task is not available, or share any information you deem important about missing functionality or limitations. Use this when you cannot accomplish what was requested because the required functionality is missing or access is restricted.", "inputSchema": { "type": "object", - "required": [ - "reason" - ], + "required": ["reason"], "properties": { "tool": { "type": "string", @@ -648,9 +524,7 @@ "description": "Log a transparency message when no significant actions are needed. Use this to confirm workflow completion and provide visibility when analysis is complete but no changes or outputs are required (e.g., 'No issues found', 'All checks passed'). This ensures the workflow produces human-visible output even when no other actions are taken.", "inputSchema": { "type": "object", - "required": [ - "message" - ], + "required": ["message"], "properties": { "message": { "type": "string", @@ -665,23 +539,14 @@ "description": "Link an issue as a sub-issue of a parent issue. Use this to establish parent-child relationships between issues for better organization and tracking of related work items.", "inputSchema": { "type": "object", - "required": [ - "parent_issue_number", - "sub_issue_number" - ], + "required": ["parent_issue_number", "sub_issue_number"], "properties": { "parent_issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "The parent issue number to link the sub-issue to. This is the numeric ID from the GitHub URL (e.g., 100 in github.com/owner/repo/issues/100)." }, "sub_issue_number": { - "type": [ - "number", - "string" - ], + "type": ["number", "string"], "description": "The issue number to link as a sub-issue of the parent. This is the numeric ID from the GitHub URL (e.g., 101 in github.com/owner/repo/issues/101)." } }, @@ -693,9 +558,7 @@ "description": "Hide a comment on a GitHub issue, pull request, or discussion. This collapses the comment and marks it as spam, abuse, off-topic, outdated, or resolved. Use this for inappropriate, off-topic, or outdated comments. The comment_id must be a GraphQL node ID (string like 'IC_kwDOABCD123456'), not a numeric REST API comment ID.", "inputSchema": { "type": "object", - "required": [ - "comment_id" - ], + "required": ["comment_id"], "properties": { "comment_id": { "type": "string", @@ -703,13 +566,7 @@ }, "reason": { "type": "string", - "enum": [ - "SPAM", - "ABUSE", - "OFF_TOPIC", - "OUTDATED", - "RESOLVED" - ], + "enum": ["SPAM", "ABUSE", "OFF_TOPIC", "OUTDATED", "RESOLVED"], "description": "Optional reason for hiding the comment. Defaults to SPAM if not provided. Valid values: SPAM (spam content), ABUSE (abusive/harassment content), OFF_TOPIC (not relevant to discussion), OUTDATED (no longer applicable), RESOLVED (issue/question has been resolved)." } }, @@ -729,11 +586,7 @@ }, "content_type": { "type": "string", - "enum": [ - "issue", - "pull_request", - "draft_issue" - ], + "enum": ["issue", "pull_request", "draft_issue"], "description": "Type of item to add to the project. Use 'issue' or 'pull_request' to add existing repo content, or 'draft_issue' to create a draft item inside the project." }, "content_number": { @@ -763,26 +616,15 @@ }, "oneOf": [ { - "required": [ - "project", - "content_type", - "content_number" - ], + "required": ["project", "content_type", "content_number"], "properties": { "content_type": { - "enum": [ - "issue", - "pull_request" - ] + "enum": ["issue", "pull_request"] } } }, { - "required": [ - "project", - "content_type", - "draft_title" - ], + "required": ["project", "content_type", "draft_title"], "properties": { "content_type": { "const": "draft_issue" @@ -798,10 +640,7 @@ "description": "Report that data or information needed to complete the task is not available. Use this when you cannot accomplish what was requested because required data, context, or information is missing.", "inputSchema": { "type": "object", - "required": [ - "data_type", - "reason" - ], + "required": ["data_type", "reason"], "properties": { "data_type": { "type": "string", From d8bd867fdfda85b4fac873758a170e2d49aa7c4a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 10:55:28 +0000 Subject: [PATCH 4/6] Add pull request support to assign_to_agent tool Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .github/workflows/campaign-generator.lock.yml | 26 +++++- .github/workflows/issue-monster.lock.yml | 26 +++++- .../playground-assign-to-agent.lock.yml | 26 +++++- .github/workflows/workflow-generator.lock.yml | 26 +++++- actions/setup/js/assign_agent_helpers.cjs | 61 +++++++++++-- actions/setup/js/assign_to_agent.cjs | 91 ++++++++++++++----- actions/setup/js/assign_to_agent.test.cjs | 2 +- actions/setup/js/safe_outputs_tools.json | 19 +++- pkg/workflow/js/safe_outputs_tools.json | 28 ++++-- 9 files changed, 246 insertions(+), 59 deletions(-) diff --git a/.github/workflows/campaign-generator.lock.yml b/.github/workflows/campaign-generator.lock.yml index b8e0eddeec4..25d27bc537e 100644 --- a/.github/workflows/campaign-generator.lock.yml +++ b/.github/workflows/campaign-generator.lock.yml @@ -230,25 +230,41 @@ jobs: "name": "add_comment" }, { - "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", + "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": { "additionalProperties": false, + "oneOf": [ + { + "required": [ + "issue_number" + ] + }, + { + "required": [ + "pull_number" + ] + } + ], "properties": { "agent": { "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified.", "type": "string" }, "issue_number": { - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements.", + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both.", + "type": [ + "number", + "string" + ] + }, + "pull_number": { + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both.", "type": [ "number", "string" ] } }, - "required": [ - "issue_number" - ], "type": "object" }, "name": "assign_to_agent" diff --git a/.github/workflows/issue-monster.lock.yml b/.github/workflows/issue-monster.lock.yml index b52fee08e99..76585071d78 100644 --- a/.github/workflows/issue-monster.lock.yml +++ b/.github/workflows/issue-monster.lock.yml @@ -209,25 +209,41 @@ jobs: "name": "add_comment" }, { - "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\") CONSTRAINTS: Maximum 3 issue(s) can be assigned 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\") CONSTRAINTS: Maximum 3 issue(s) can be assigned to agent.", "inputSchema": { "additionalProperties": false, + "oneOf": [ + { + "required": [ + "issue_number" + ] + }, + { + "required": [ + "pull_number" + ] + } + ], "properties": { "agent": { "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified.", "type": "string" }, "issue_number": { - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements.", + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both.", + "type": [ + "number", + "string" + ] + }, + "pull_number": { + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both.", "type": [ "number", "string" ] } }, - "required": [ - "issue_number" - ], "type": "object" }, "name": "assign_to_agent" diff --git a/.github/workflows/playground-assign-to-agent.lock.yml b/.github/workflows/playground-assign-to-agent.lock.yml index 273a43c36da..6c5dab798fd 100644 --- a/.github/workflows/playground-assign-to-agent.lock.yml +++ b/.github/workflows/playground-assign-to-agent.lock.yml @@ -178,25 +178,41 @@ jobs: cat > /opt/gh-aw/safeoutputs/tools.json << 'EOF' [ { - "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\") CONSTRAINTS: Maximum 1 issue(s) can be assigned 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\") CONSTRAINTS: Maximum 1 issue(s) can be assigned to agent.", "inputSchema": { "additionalProperties": false, + "oneOf": [ + { + "required": [ + "issue_number" + ] + }, + { + "required": [ + "pull_number" + ] + } + ], "properties": { "agent": { "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified.", "type": "string" }, "issue_number": { - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements.", + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both.", + "type": [ + "number", + "string" + ] + }, + "pull_number": { + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both.", "type": [ "number", "string" ] } }, - "required": [ - "issue_number" - ], "type": "object" }, "name": "assign_to_agent" diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index 387d8cb6a88..b352d209c87 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -208,25 +208,41 @@ jobs: cat > /opt/gh-aw/safeoutputs/tools.json << 'EOF' [ { - "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", + "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": { "additionalProperties": false, + "oneOf": [ + { + "required": [ + "issue_number" + ] + }, + { + "required": [ + "pull_number" + ] + } + ], "properties": { "agent": { "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified.", "type": "string" }, "issue_number": { - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements.", + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both.", + "type": [ + "number", + "string" + ] + }, + "pull_number": { + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both.", "type": [ "number", "string" ] } }, - "required": [ - "issue_number" - ], "type": "object" }, "name": "assign_to_agent" diff --git a/actions/setup/js/assign_agent_helpers.cjs b/actions/setup/js/assign_agent_helpers.cjs index 23dd6d37181..bb4daeb4785 100644 --- a/actions/setup/js/assign_agent_helpers.cjs +++ b/actions/setup/js/assign_agent_helpers.cjs @@ -173,14 +173,60 @@ async function getIssueDetails(owner, repo, issueNumber) { } /** - * Assign agent to issue using GraphQL replaceActorsForAssignable mutation - * @param {string} issueId - GitHub issue ID + * Get pull request details (ID and current assignees) using GraphQL + * @param {string} owner - Repository owner + * @param {string} repo - Repository name + * @param {number} pullNumber - Pull request number + * @returns {Promise<{pullRequestId: string, currentAssignees: string[]}|null>} + */ +async function getPullRequestDetails(owner, repo, pullNumber) { + const query = ` + query($owner: String!, $repo: String!, $pullNumber: Int!) { + repository(owner: $owner, name: $repo) { + pullRequest(number: $pullNumber) { + id + assignees(first: 100) { + nodes { + id + } + } + } + } + } + `; + + try { + const response = await github.graphql(query, { owner, repo, pullNumber }); + const pullRequest = response.repository.pullRequest; + + if (!pullRequest || !pullRequest.id) { + core.error("Could not get pull request data"); + return null; + } + + const currentAssignees = pullRequest.assignees.nodes.map(assignee => assignee.id); + + return { + pullRequestId: pullRequest.id, + currentAssignees, + }; + } catch (error) { + const errorMessage = getErrorMessage(error); + core.error(`Failed to get pull request details: ${errorMessage}`); + // Re-throw the error to preserve the original error message for permission error detection + throw error; + } +} + +/** + * Assign agent to issue or pull request using GraphQL replaceActorsForAssignable mutation + * @param {string} assignableId - GitHub issue or pull request ID * @param {string} agentId - Agent ID * @param {string[]} currentAssignees - List of current assignee IDs * @param {string} agentName - Agent name for error messages * @returns {Promise} True if successful */ -async function assignAgentToIssue(issueId, agentId, currentAssignees, agentName) { +async function assignAgentToIssue(assignableId, agentId, currentAssignees, agentName) { // Build actor IDs array - include agent and preserve other assignees const actorIds = [agentId, ...currentAssignees.filter(id => id !== agentId)]; @@ -198,9 +244,9 @@ async function assignAgentToIssue(issueId, agentId, currentAssignees, agentName) try { core.info("Using built-in github object for mutation"); - core.debug(`GraphQL mutation with variables: assignableId=${issueId}, actorIds=${JSON.stringify(actorIds)}`); + core.debug(`GraphQL mutation with variables: assignableId=${assignableId}, actorIds=${JSON.stringify(actorIds)}`); const response = await github.graphql(mutation, { - assignableId: issueId, + assignableId: assignableId, actorIds, }); @@ -295,9 +341,9 @@ async function assignAgentToIssue(issueId, agentId, currentAssignees, agentName) } `; core.info("Using built-in github object for fallback mutation"); - core.debug(`Fallback GraphQL mutation with variables: assignableId=${issueId}, assigneeIds=[${agentId}]`); + core.debug(`Fallback GraphQL mutation with variables: assignableId=${assignableId}, assigneeIds=[${agentId}]`); const fallbackResp = await github.graphql(fallbackMutation, { - assignableId: issueId, + assignableId: assignableId, assigneeIds: [agentId], }); if (fallbackResp?.addAssigneesToAssignable) { @@ -447,6 +493,7 @@ module.exports = { getAvailableAgentLogins, findAgent, getIssueDetails, + getPullRequestDetails, assignAgentToIssue, logPermissionError, generatePermissionErrorSummary, diff --git a/actions/setup/js/assign_to_agent.cjs b/actions/setup/js/assign_to_agent.cjs index b29a7f5f09b..6e90f184568 100644 --- a/actions/setup/js/assign_to_agent.cjs +++ b/actions/setup/js/assign_to_agent.cjs @@ -3,7 +3,7 @@ const { loadAgentOutput } = require("./load_agent_output.cjs"); const { generateStagedPreview } = require("./staged_preview.cjs"); -const { AGENT_LOGIN_NAMES, getAvailableAgentLogins, findAgent, getIssueDetails, assignAgentToIssue, generatePermissionErrorSummary } = require("./assign_agent_helpers.cjs"); +const { AGENT_LOGIN_NAMES, getAvailableAgentLogins, findAgent, getIssueDetails, getPullRequestDetails, assignAgentToIssue, generatePermissionErrorSummary } = require("./assign_agent_helpers.cjs"); const { getErrorMessage } = require("./error_helpers.cjs"); async function main() { @@ -27,7 +27,12 @@ async function main() { description: "The following agent assignments would be made if staged mode was disabled:", items: assignItems, renderItem: item => { - let content = `**Issue:** #${item.issue_number}\n`; + let content = ""; + if (item.issue_number) { + content += `**Issue:** #${item.issue_number}\n`; + } else if (item.pull_number) { + content += `**Pull Request:** #${item.pull_number}\n`; + } content += `**Agent:** ${item.agent || "copilot"}\n`; content += "\n"; return content; @@ -80,11 +85,27 @@ async function main() { // Process each agent assignment const results = []; for (const item of itemsToProcess) { - const issueNumber = typeof item.issue_number === "number" ? item.issue_number : parseInt(String(item.issue_number), 10); + // Determine if this is an issue or PR assignment + const issueNumber = item.issue_number ? (typeof item.issue_number === "number" ? item.issue_number : parseInt(String(item.issue_number), 10)) : null; + const pullNumber = item.pull_number ? (typeof item.pull_number === "number" ? item.pull_number : parseInt(String(item.pull_number), 10)) : null; const agentName = item.agent ?? defaultAgent; - if (isNaN(issueNumber) || issueNumber <= 0) { - core.error(`Invalid issue_number: ${item.issue_number}`); + // Validate that we have either issue_number or pull_number + if (!issueNumber && !pullNumber) { + core.error("Missing both issue_number and pull_number in assign_to_agent item"); + continue; + } + + if (issueNumber && pullNumber) { + core.error("Cannot specify both issue_number and pull_number in the same assign_to_agent item"); + continue; + } + + const number = issueNumber || pullNumber; + const type = issueNumber ? "issue" : "pull request"; + + if (isNaN(number) || number <= 0) { + core.error(`Invalid ${type} number: ${number}`); continue; } @@ -93,6 +114,7 @@ async function main() { core.warning(`Agent "${agentName}" is not supported. Supported agents: ${Object.keys(AGENT_LOGIN_NAMES).join(", ")}`); results.push({ issue_number: issueNumber, + pull_number: pullNumber, agent: agentName, success: false, error: `Unsupported agent: ${agentName}`, @@ -100,7 +122,7 @@ async function main() { continue; } - // Assign the agent to the issue using GraphQL + // Assign the agent to the issue or PR using GraphQL try { // Find agent (use cache if available) - uses built-in github object authenticated via github-token let agentId = agentCache[agentName]; @@ -114,20 +136,35 @@ async function main() { core.info(`Found ${agentName} coding agent (ID: ${agentId})`); } - // Get issue details (ID and current assignees) via GraphQL - core.info("Getting issue details..."); - const issueDetails = await getIssueDetails(targetOwner, targetRepo, issueNumber); - if (!issueDetails) { - throw new Error("Failed to get issue details"); + // Get issue or PR details (ID and current assignees) via GraphQL + core.info(`Getting ${type} details...`); + let assignableId; + let currentAssignees; + + if (issueNumber) { + const issueDetails = await getIssueDetails(targetOwner, targetRepo, issueNumber); + if (!issueDetails) { + throw new Error(`Failed to get issue details`); + } + assignableId = issueDetails.issueId; + currentAssignees = issueDetails.currentAssignees; + } else { + const prDetails = await getPullRequestDetails(targetOwner, targetRepo, pullNumber); + if (!prDetails) { + throw new Error(`Failed to get pull request details`); + } + assignableId = prDetails.pullRequestId; + currentAssignees = prDetails.currentAssignees; } - core.info(`Issue ID: ${issueDetails.issueId}`); + core.info(`${type} ID: ${assignableId}`); // Check if agent is already assigned - if (issueDetails.currentAssignees.includes(agentId)) { - core.info(`${agentName} is already assigned to issue #${issueNumber}`); + if (currentAssignees.includes(agentId)) { + core.info(`${agentName} is already assigned to ${type} #${number}`); results.push({ issue_number: issueNumber, + pull_number: pullNumber, agent: agentName, success: true, }); @@ -135,16 +172,17 @@ async function main() { } // Assign agent using GraphQL mutation - uses built-in github object authenticated via github-token - core.info(`Assigning ${agentName} coding agent to issue #${issueNumber}...`); - const success = await assignAgentToIssue(issueDetails.issueId, agentId, issueDetails.currentAssignees, agentName); + core.info(`Assigning ${agentName} coding agent to ${type} #${number}...`); + const success = await assignAgentToIssue(assignableId, agentId, currentAssignees, agentName); if (!success) { throw new Error(`Failed to assign ${agentName} via GraphQL`); } - core.info(`Successfully assigned ${agentName} coding agent to issue #${issueNumber}`); + core.info(`Successfully assigned ${agentName} coding agent to ${type} #${number}`); results.push({ issue_number: issueNumber, + pull_number: pullNumber, agent: agentName, success: true, }); @@ -161,9 +199,10 @@ async function main() { core.debug("Failed to enrich unavailable agent message with available list"); } } - core.error(`Failed to assign agent "${agentName}" to issue #${issueNumber}: ${errorMessage}`); + core.error(`Failed to assign agent "${agentName}" to ${type} #${number}: ${errorMessage}`); results.push({ issue_number: issueNumber, + pull_number: pullNumber, agent: agentName, success: false, error: errorMessage, @@ -181,7 +220,10 @@ async function main() { summaryContent += `✅ Successfully assigned ${successCount} agent(s):\n\n`; summaryContent += results .filter(r => r.success) - .map(r => `- Issue #${r.issue_number} → Agent: ${r.agent}`) + .map(r => { + const itemType = r.issue_number ? `Issue #${r.issue_number}` : `Pull Request #${r.pull_number}`; + return `- ${itemType} → Agent: ${r.agent}`; + }) .join("\n"); summaryContent += "\n\n"; } @@ -190,7 +232,10 @@ async function main() { summaryContent += `❌ Failed to assign ${failureCount} agent(s):\n\n`; summaryContent += results .filter(r => !r.success) - .map(r => `- Issue #${r.issue_number} → Agent: ${r.agent}: ${r.error}`) + .map(r => { + const itemType = r.issue_number ? `Issue #${r.issue_number}` : `Pull Request #${r.pull_number}`; + return `- ${itemType} → Agent: ${r.agent}: ${r.error}`; + }) .join("\n"); // Check if any failures were permission-related @@ -206,7 +251,11 @@ async function main() { // Set outputs const assignedAgents = results .filter(r => r.success) - .map(r => `${r.issue_number}:${r.agent}`) + .map(r => { + const number = r.issue_number || r.pull_number; + const prefix = r.issue_number ? "issue" : "pr"; + return `${prefix}:${number}:${r.agent}`; + }) .join("\n"); core.setOutput("assigned_agents", assignedAgents); diff --git a/actions/setup/js/assign_to_agent.test.cjs b/actions/setup/js/assign_to_agent.test.cjs index 39d986cd625..d37c628711b 100644 --- a/actions/setup/js/assign_to_agent.test.cjs +++ b/actions/setup/js/assign_to_agent.test.cjs @@ -227,7 +227,7 @@ describe("assign_to_agent", () => { await eval(`(async () => { ${assignToAgentScript}; await main(); })()`); - expect(mockCore.error).toHaveBeenCalledWith(expect.stringContaining("Invalid issue_number")); + expect(mockCore.error).toHaveBeenCalledWith(expect.stringContaining("Invalid issue number")); }); it("should handle agent already assigned", async () => { diff --git a/actions/setup/js/safe_outputs_tools.json b/actions/setup/js/safe_outputs_tools.json index 6687abfbb90..be96b9081ad 100644 --- a/actions/setup/js/safe_outputs_tools.json +++ b/actions/setup/js/safe_outputs_tools.json @@ -337,21 +337,32 @@ }, { "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", + "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", - "required": ["issue_number"], "properties": { "issue_number": { "type": ["number", "string"], - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements." + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both." + }, + "pull_number": { + "type": ["number", "string"], + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both." }, "agent": { "type": "string", "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified." } }, - "additionalProperties": false + "additionalProperties": false, + "oneOf": [ + { + "required": ["issue_number"] + }, + { + "required": ["pull_number"] + } + ] } }, { diff --git a/pkg/workflow/js/safe_outputs_tools.json b/pkg/workflow/js/safe_outputs_tools.json index fc9fcd9d75d..a5f69ccb01f 100644 --- a/pkg/workflow/js/safe_outputs_tools.json +++ b/pkg/workflow/js/safe_outputs_tools.json @@ -489,26 +489,42 @@ }, { "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. Example usage: assign_to_agent(issue_number=123, agent=\"copilot\")", + "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", - "required": [ - "issue_number" - ], "properties": { "issue_number": { "type": [ "number", "string" ], - "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements." + "description": "Issue number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 234 in github.com/owner/repo/issues/234). The issue should contain clear, actionable requirements. Either issue_number or pull_number must be provided, but not both." + }, + "pull_number": { + "type": [ + "number", + "string" + ], + "description": "Pull request number to assign the Copilot agent to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/pull/456). Either issue_number or pull_number must be provided, but not both." }, "agent": { "type": "string", "description": "Agent identifier to assign. Defaults to 'copilot' (the Copilot coding agent) if not specified." } }, - "additionalProperties": false + "additionalProperties": false, + "oneOf": [ + { + "required": [ + "issue_number" + ] + }, + { + "required": [ + "pull_number" + ] + } + ] } }, { From 89655ca985365f6d8d02f7fddd618ad526948842 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:09:11 +0000 Subject: [PATCH 5/6] Update safe-outputs documentation for assign_to_agent PR support Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- docs/src/content/docs/reference/safe-outputs.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index efc089c9e90..c4e7186b15d 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -49,7 +49,7 @@ The agent requests issue creation; a separate job with `issues: write` creates i - [**Add Labels**](#add-labels-add-labels) (`add-labels`) — Add labels to issues or PRs (max: 3) - [**Add Reviewer**](#add-reviewer-add-reviewer) (`add-reviewer`) — Add reviewers to pull requests (max: 3) - [**Assign Milestone**](#assign-milestone-assign-milestone) (`assign-milestone`) — Assign issues to milestones (max: 1) -- [**Assign to Agent**](#assign-to-agent-assign-to-agent) (`assign-to-agent`) — Assign Copilot agents to issues (max: 1) +- [**Assign to Agent**](#assign-to-agent-assign-to-agent) (`assign-to-agent`) — Assign Copilot agents to issues or PRs (max: 1) - [**Assign to User**](#assign-to-user-assign-to-user) (`assign-to-user`) — Assign users to issues (max: 1) ### Projects, Releases & Assets @@ -746,13 +746,15 @@ Creates Copilot agent sessions. Requires `COPILOT_GITHUB_TOKEN` or `GH_AW_GITHUB ### Assign to Agent (`assign-to-agent:`) -Assigns Copilot coding agent to issues. Requires fine-grained PAT with actions, contents, issues, pull requests write access stored as `GH_AW_AGENT_TOKEN`, or GitHub App token. Supported agents: `copilot` (`copilot-swe-agent`). +Assigns Copilot coding agent to issues or pull requests. Requires fine-grained PAT with actions, contents, issues, pull requests write access stored as `GH_AW_AGENT_TOKEN`, or GitHub App token. Supported agents: `copilot` (`copilot-swe-agent`). + +The agent must provide either `issue_number` or `pull_number` in the output to specify which item to assign. ```yaml wrap safe-outputs: assign-to-agent: - name: "copilot" - target-repo: "owner/repo" # cross-repository + name: "copilot" # default agent (optional) + target-repo: "owner/repo" # cross-repository ``` ### Assign to User (`assign-to-user:`) From 8bb6202ccc64519c0a1377aed89f4a3762903cd1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:19:45 +0000 Subject: [PATCH 6/6] Update playground assign-to-agent workflow to support PR URLs Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com> --- .../discussion-task-mining.campaign.lock.yml | 2 +- ...ty-maintenance-project67.campaign.lock.yml | 2 +- ...size-reduction-project71.campaign.lock.yml | 2 +- .../playground-assign-to-agent.lock.yml | 28 ++++++++++--------- .../workflows/playground-assign-to-agent.md | 20 +++++++------ 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/discussion-task-mining.campaign.lock.yml b/.github/workflows/discussion-task-mining.campaign.lock.yml index 1fd4548b6a9..0067b4519d7 100644 --- a/.github/workflows/discussion-task-mining.campaign.lock.yml +++ b/.github/workflows/discussion-task-mining.campaign.lock.yml @@ -1103,7 +1103,7 @@ jobs: | Field | Type | Allowed / Notes | |---|---|---| - | `status` | single-select | `Todo` / `In Progress` / `Done` | + | `status` | single-select | `Todo` / `In Progress` / `Review required` / `Blocked` / `Done` | | `campaign_id` | text | Must equal `discussion-task-mining` | | `worker_workflow` | text | workflow ID or `"unknown"` | | `repository` | text | `owner/repo` | diff --git a/.github/workflows/docs-quality-maintenance-project67.campaign.lock.yml b/.github/workflows/docs-quality-maintenance-project67.campaign.lock.yml index 98e98f2fad9..c6bdeeb8f7f 100644 --- a/.github/workflows/docs-quality-maintenance-project67.campaign.lock.yml +++ b/.github/workflows/docs-quality-maintenance-project67.campaign.lock.yml @@ -1113,7 +1113,7 @@ jobs: | Field | Type | Allowed / Notes | |---|---|---| - | `status` | single-select | `Todo` / `In Progress` / `Done` | + | `status` | single-select | `Todo` / `In Progress` / `Review required` / `Blocked` / `Done` | | `campaign_id` | text | Must equal `docs-quality-maintenance-project73` | | `worker_workflow` | text | workflow ID or `"unknown"` | | `repository` | text | `owner/repo` | diff --git a/.github/workflows/file-size-reduction-project71.campaign.lock.yml b/.github/workflows/file-size-reduction-project71.campaign.lock.yml index 8075e6e0d7b..34ee1b1aa56 100644 --- a/.github/workflows/file-size-reduction-project71.campaign.lock.yml +++ b/.github/workflows/file-size-reduction-project71.campaign.lock.yml @@ -1110,7 +1110,7 @@ jobs: | Field | Type | Allowed / Notes | |---|---|---| - | `status` | single-select | `Todo` / `In Progress` / `Done` | + | `status` | single-select | `Todo` / `In Progress` / `Review required` / `Blocked` / `Done` | | `campaign_id` | text | Must equal `file-size-reduction-project71` | | `worker_workflow` | text | workflow ID or `"unknown"` | | `repository` | text | `owner/repo` | diff --git a/.github/workflows/playground-assign-to-agent.lock.yml b/.github/workflows/playground-assign-to-agent.lock.yml index 6c5dab798fd..6883c9f9c02 100644 --- a/.github/workflows/playground-assign-to-agent.lock.yml +++ b/.github/workflows/playground-assign-to-agent.lock.yml @@ -25,8 +25,8 @@ name: "Playground: assign-to-agent" "on": workflow_dispatch: inputs: - issue_url: - description: Issue URL to assign agent to (e.g., https://github.com/owner/repo/issues/123) + item_url: + description: Issue or PR URL to assign agent to (e.g., https://github.com/owner/repo/issues/123 or https://github.com/owner/repo/pull/456) required: true type: string @@ -462,31 +462,33 @@ jobs: env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }} - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL: ${{ github.event.inputs.issue_url }} + GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL: ${{ github.event.inputs.item_url }} run: | bash /opt/gh-aw/actions/create_prompt_first.sh cat << 'PROMPT_EOF' > "$GH_AW_PROMPT" # Assign Agent Test Workflow - Test the `assign-to-agent` safe output feature by assigning the Copilot agent to an issue. + Test the `assign-to-agent` safe output feature by assigning the Copilot agent to an issue or pull request. ## Task - You have been provided with an issue URL: __GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL__ + You have been provided with a GitHub URL: __GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL__ - 1. Parse the issue URL to extract the owner, repo, and issue number - 2. Validate that the URL is an issue URL (not a pull request URL) - 3. Use the `assign_to_agent` tool from the `safeoutputs` MCP server to assign the Copilot agent to the issue - 4. Pass the numeric issue_number (extracted from the URL) to the `assign_to_agent` tool + 1. Parse the URL to extract the owner, repo, and number + 2. Determine if the URL is an issue URL (contains `/issues/`) or a pull request URL (contains `/pull/`) + 3. Use the `assign_to_agent` tool from the `safeoutputs` MCP server to assign the Copilot agent + 4. Pass the appropriate parameter to the tool: + - For issues: pass `issue_number` (the numeric ID extracted from the URL) + - For pull requests: pass `pull_number` (the numeric ID extracted from the URL) - **Important**: Do not use GitHub tools directly for assignment. Only use the `assign_to_agent` safe output tool. + **Important**: Do not use GitHub tools directly for assignment. Only use the `assign_to_agent` safe output tool with the correct parameter based on the URL type. PROMPT_EOF - name: Substitute placeholders uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL: ${{ github.event.inputs.issue_url }} + GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL: ${{ github.event.inputs.item_url }} with: script: | const substitutePlaceholders = require('/opt/gh-aw/actions/substitute_placeholders.cjs'); @@ -495,7 +497,7 @@ jobs: return await substitutePlaceholders({ file: process.env.GH_AW_PROMPT, substitutions: { - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL: process.env.GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL + GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL: process.env.GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL } }); - name: Append XPIA security instructions to prompt @@ -603,7 +605,7 @@ jobs: uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 env: GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt - GH_AW_GITHUB_EVENT_INPUTS_ISSUE_URL: ${{ github.event.inputs.issue_url }} + GH_AW_GITHUB_EVENT_INPUTS_ITEM_URL: ${{ github.event.inputs.item_url }} with: script: | const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs'); diff --git a/.github/workflows/playground-assign-to-agent.md b/.github/workflows/playground-assign-to-agent.md index d6416a4795c..57b55d7ff4b 100644 --- a/.github/workflows/playground-assign-to-agent.md +++ b/.github/workflows/playground-assign-to-agent.md @@ -3,8 +3,8 @@ name: "Playground: assign-to-agent" on: workflow_dispatch: inputs: - issue_url: - description: 'Issue URL to assign agent to (e.g., https://github.com/owner/repo/issues/123)' + item_url: + description: 'Issue or PR URL to assign agent to (e.g., https://github.com/owner/repo/issues/123 or https://github.com/owner/repo/pull/456)' required: true type: string description: Test assign-to-agent safe output feature @@ -32,15 +32,17 @@ timeout-minutes: 5 # Assign Agent Test Workflow -Test the `assign-to-agent` safe output feature by assigning the Copilot agent to an issue. +Test the `assign-to-agent` safe output feature by assigning the Copilot agent to an issue or pull request. ## Task -You have been provided with an issue URL: ${{ github.event.inputs.issue_url }} +You have been provided with a GitHub URL: ${{ github.event.inputs.item_url }} -1. Parse the issue URL to extract the owner, repo, and issue number -2. Validate that the URL is an issue URL (not a pull request URL) -3. Use the `assign_to_agent` tool from the `safeoutputs` MCP server to assign the Copilot agent to the issue -4. Pass the numeric issue_number (extracted from the URL) to the `assign_to_agent` tool +1. Parse the URL to extract the owner, repo, and number +2. Determine if the URL is an issue URL (contains `/issues/`) or a pull request URL (contains `/pull/`) +3. Use the `assign_to_agent` tool from the `safeoutputs` MCP server to assign the Copilot agent +4. Pass the appropriate parameter to the tool: + - For issues: pass `issue_number` (the numeric ID extracted from the URL) + - For pull requests: pass `pull_number` (the numeric ID extracted from the URL) -**Important**: Do not use GitHub tools directly for assignment. Only use the `assign_to_agent` safe output tool. +**Important**: Do not use GitHub tools directly for assignment. Only use the `assign_to_agent` safe output tool with the correct parameter based on the URL type.