Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

Summary

Exports WithGraphQLFeatures function to enable remote server to set GraphQL-Features header for assign_copilot_to_issue tool.

Why

The remote server's HTTP roundtripper couldn't access the context helper to add feature flags, causing GraphQL schema errors when using assign_copilot_to_issue:

Variable $input of type UpdateIssueInput! was provided invalid value for agentAssignment (Field is not defined on UpdateIssueInput)

What changed

  • Renamed withGraphQLFeaturesWithGraphQLFeatures in pkg/github/issues.go to export function
  • Added TestGraphQLFeatures test coverage for context helpers

MCP impact

  • No tool or API changes — Internal library function export only

Prompts tested (tool changes only)

N/A

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

  • Not needed

Technical Details

The remote server (which uses this repo as a library) can now implement its roundtripper:

func (t *customTransport) RoundTrip(req *http.Request) (*http.Response, error) {
    req = req.Clone(req.Context())
    
    if features := github.GetGraphQLFeatures(req.Context()); len(features) > 0 {
        req.Header.Set("GraphQL-Features", strings.Join(features, ", "))
    }
    
    return t.transport.RoundTrip(req)
}

This enables the issues_copilot_assignment_api_support flag required for the agentAssignment field.

Original prompt

This section details on the original issue you should resolve

<issue_title>assign_copilot_to_issue fails with GraphQL schema error: agentAssignment field not defined on UpdateIssueInput</issue_title>
<issue_description>### Describe the bug

The assign_copilot_to_issue tool fails with a GraphQL schema validation error when attempting to assign Copilot to an issue. The error indicates that the agentAssignment field is not defined on the UpdateIssueInput type.

Affected version

Using the MCP server integrated with VS Code Copilot (remote MCP).

Steps to reproduce the behavior

  1. Enable the GitHub MCP server in VS Code
  2. Create an issue in a repository that has Copilot coding agent enabled
  3. Attempt to assign Copilot to the issue using the assign_copilot_to_issue tool with valid owner, repo, and issue_number parameters

Expected vs actual behavior

Expected: Copilot should be assigned to the issue.

Actual: The tool returns an error:

failed to update issue with agent assignment: Variable $input of type UpdateIssueInput! was provided invalid value for agentAssignment (Field is not defined on UpdateIssueInput)

Logs

ERROR while calling tool: MPC 0: failed to update issue with agent assignment: Variable $input of type UpdateIssueInput! was provided invalid value for agentAssignment (Field is not defined on UpdateIssueInput)

Created with GitHub Copilot. This issue was written with AI assistance.</issue_description>

Comments on the Issue (you are @copilot in this section)

@SamMorrowDrums https://github.com//pull/1779 This is the code that introduced it, and this is the documentation: https://github.blog/changelog/2025-12-03-assign-issues-to-copilot-using-the-api/ are you perhaps opted out of some behaviour that would prevent this explicitly? @SamMorrowDrums I can reporoduce though `Error: MPC 0: failed to update issue with agent assignment: Variable $input of type UpdateIssueInput! was provided invalid value for agentAssignment (Field is not defined on UpdateIssueInput)`

So I need to investigate.</comment_new>
<comment_new>@TylerDixon
👋 @C-Ross Did this happen to be from a personal, non-staff account?</comment_new>
<comment_new>@C-Ross
@TylerDixon No, this is my primary staff enabled account (frankly I don't have any others). I was actively using the same account to interact with GitHub repos and used the same account to successfully assign copilot from the UI.</comment_new>
<comment_new>@SamMorrowDrums
We confirmed that this is isolated to the remote server, due to a minor difference in the GraphQL http roundtripper that means the required feature flag is not being set on the remote server only. A fix is ready and will be deployed once reviewed.</comment_new>
<comment_new>@SamMorrowDrums
All working, thanks for report!</comment_new>


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

- Renamed withGraphQLFeatures to WithGraphQLFeatures to export it
- This allows the remote server to add GraphQL feature flags to context
- Added comprehensive tests for GraphQL features context functions
- All tests pass and linter reports no issues

Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GraphQL schema error on assign_copilot_to_issue Export WithGraphQLFeatures for remote server GraphQL feature flag support Jan 14, 2026
Copilot AI requested a review from SamMorrowDrums January 14, 2026 13:11
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.

assign_copilot_to_issue fails with GraphQL schema error: agentAssignment field not defined on UpdateIssueInput

2 participants