Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

Summary

Adds optional base_ref parameter to assign_copilot_to_issue tool and migrates from replaceActorsForAssignable to updateIssue GraphQL mutation with agentAssignment field.

Why

Enables specifying which branch Copilot should start from when working on an issue. Previously, only the default branch could be used.

Related: community/community#173575 (comment)

What changed

  • Added optional base_ref parameter to tool schema (defaults to repository default branch if omitted)
  • Replaced replaceActorsForAssignable mutation with updateIssue mutation using agentAssignment field
  • Added AgentAssignmentInput and UpdateIssueInput structs for new GraphQL mutation structure
  • Updated query to fetch repository ID alongside issue ID in single call
  • Updated all test cases to use new mutation structure, added test for base_ref parameter

MCP impact

  • Tool schema or behavior changed
    Tool now accepts optional base_ref parameter. GraphQL mutation changed from replaceActorsForAssignable to updateIssue with agentAssignment field containing baseRef, customAgent, customInstructions, and targetRepositoryId.

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

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

Docs

  • Updated (README / docs / examples)
Original prompt

The assign issue to copilot tool should now enable base branch specification:

<<<
This should be possible now we've opened up the GraphQL endpoint - however we might want to wait until the FF has been promoted so that we don't have to send FFs in the GraphQL Request Header.

We used the ref for the branch:

gh api graphql -f query='mutation() {
updateIssue(input:{
id:$ISSUE_ID,
assigneeIds:["BOT_kgDOC9w8XQ"],
agentAssignment:{ baseRef: "main", customAgent: "", customInstructions: "Add a cat emoji to the readme", targetRepositoryId: $REPO_ID }}){issue{url number id}}}' -H 'GraphQL-Features: issues_copilot_assignment_api_support'
So it should be simpler - not providing a baseRef should mean that the base branch is used.

Don't worry about the feature flag, just look at implementing the correct mutation with optional argument.


💡 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.

- Add optional base_ref parameter to tool schema
- Change from replaceActorsForAssignable to updateIssue mutation with agentAssignment
- Add AgentAssignmentInput and UpdateIssueInput structs for new GraphQL mutation
- Update all tests to use new mutation structure
- Add test case for base_ref functionality
- Update toolsnaps and documentation

Co-authored-by: SamMorrowDrums <[email protected]>
Copilot AI changed the title [WIP] Add base branch specification to assign issue mutation Add base_ref parameter to assign_copilot_to_issue tool Jan 10, 2026
Copilot AI requested a review from SamMorrowDrums January 10, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants