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, migrates from replaceActorsForAssignable to updateIssue GraphQL mutation with agentAssignment field, and implements GraphQL-Features header support for the non-GA agent assignment API.

Why

Enables specifying which branch Copilot should start from when working on an issue. Previously, only the default branch could be used. The agent assignment API is not yet GA and requires the GraphQL-Features header to function.

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
  • Implemented context-based GraphQL feature flag system for passing features to HTTP transport layer
  • Modified bearerAuthTransport to read GraphQL features from context and add GraphQL-Features header
  • Tool now sends GraphQL-Features: issues_copilot_assignment_api_support header for agent assignment API

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. Requests now include the GraphQL-Features: issues_copilot_assignment_api_support header required by the non-GA API.

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
@SamMorrowDrums
Copy link
Collaborator

@copilot add in GraphQL-Features: issues_copilot_assignment_api_support feature to this tool please, so the API actually works, it's not GA yet so requires the feature to be provided. Related discussion is here: https://github.com/orgs/community/discussions/173575

This should use the standard github GraphQL feature support.

- Add context-based GraphQL feature flag support
- Modify bearerAuthTransport to read features from context and add GraphQL-Features header
- Use issues_copilot_assignment_api_support feature flag for updateIssue mutation
- Export GetGraphQLFeatures function for use in HTTP transport layer

This allows the assign_copilot_to_issue tool to work with the non-GA agent assignment API
by sending the required GraphQL-Features header.

Co-authored-by: SamMorrowDrums <[email protected]>
Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot add in GraphQL-Features: issues_copilot_assignment_api_support feature to this tool please, so the API actually works, it's not GA yet so requires the feature to be provided. Related discussi...

Added GraphQL-Features header support in commit ced0c4c. The tool now sends the GraphQL-Features: issues_copilot_assignment_api_support header when calling the updateIssue mutation. The implementation uses context-based feature flags that are automatically added by the HTTP transport layer.

Copilot AI changed the title Add base_ref parameter to assign_copilot_to_issue tool Add base_ref parameter and GraphQL-Features header support to assign_copilot_to_issue tool Jan 12, 2026
@SamMorrowDrums SamMorrowDrums marked this pull request as ready for review January 12, 2026 13:58
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner January 12, 2026 13:58
Copilot AI review requested due to automatic review settings January 12, 2026 13:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@SamMorrowDrums SamMorrowDrums merged commit f62ff63 into main Jan 12, 2026
22 checks passed
@SamMorrowDrums SamMorrowDrums deleted the copilot/add-base-branch-specification branch January 12, 2026 14: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.

3 participants