From 955bc533b3ed83040df3ffdb7b5a4679c8765762 Mon Sep 17 00:00:00 2001 From: Owen Niblock Date: Mon, 9 Nov 2026 10:17:56 +0000 Subject: [PATCH 1/2] Remove retired Copilot assignment feature flag Stop sending the deleted GraphQL feature flag from both Copilot assignment paths while retaining generic feature transport coverage with a synthetic fixture. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66599c3f-43e9-41be-b773-1d3dcc036472 --- pkg/github/copilot.go | 12 ++---------- pkg/github/copilot_test.go | 11 ++++++++++- pkg/http/transport/graphql_features_test.go | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pkg/github/copilot.go b/pkg/github/copilot.go index 151c7e3f59..7e267e04b9 100644 --- a/pkg/github/copilot.go +++ b/pkg/github/copilot.go @@ -10,7 +10,6 @@ import ( "strings" "time" - ghcontext "github.com/github/github-mcp-server/v2/pkg/context" ghErrors "github.com/github/github-mcp-server/v2/pkg/errors" "github.com/github/github-mcp-server/v2/pkg/inventory" "github.com/github/github-mcp-server/v2/pkg/octicons" @@ -343,8 +342,6 @@ func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.Server agentAssignment.CustomInstructions = &customInstructions } - // Execute the updateIssue mutation with the GraphQL-Features header - // This header is required for the agent assignment API which is not GA yet var updateIssueMutation struct { UpdateIssue struct { Issue struct { @@ -355,15 +352,11 @@ func AssignCopilotToIssue(t translations.TranslationHelperFunc) inventory.Server } `graphql:"updateIssue(input: $input)"` } - // Add the GraphQL-Features header for the agent assignment API - // The header will be read by the HTTP transport if it's configured to do so - ctxWithFeatures := ghcontext.WithGraphQLFeatures(ctx, "issues_copilot_assignment_api_support") - // Capture the time before assignment to filter out older PRs during polling assignmentTime := time.Now().UTC() if err := client.Mutate( - ctxWithFeatures, + ctx, &updateIssueMutation, UpdateIssueInput{ ID: getIssueQuery.Repository.Issue.ID, @@ -759,10 +752,9 @@ func AssignCopilotToIssueWithIntent(t translations.TranslationHelperFunc) invent } `graphql:"updateIssue(input: $input)"` } - ctxWithFeatures := ghcontext.WithGraphQLFeatures(ctx, "issues_copilot_assignment_api_support") assignmentTime := time.Now().UTC() - if err := client.Mutate(ctxWithFeatures, &updateIssueMutation, input, nil); err != nil { + if err := client.Mutate(ctx, &updateIssueMutation, input, nil); err != nil { return nil, nil, fmt.Errorf("failed to update issue with agent assignment: %w", err) } diff --git a/pkg/github/copilot_test.go b/pkg/github/copilot_test.go index 7d7ecf9ac7..6925a6d71c 100644 --- a/pkg/github/copilot_test.go +++ b/pkg/github/copilot_test.go @@ -12,6 +12,8 @@ import ( "github.com/github/github-mcp-server/v2/internal/githubv4mock" "github.com/github/github-mcp-server/v2/internal/toolsnaps" + "github.com/github/github-mcp-server/v2/pkg/http/headers" + transportpkg "github.com/github/github-mcp-server/v2/pkg/http/transport" "github.com/github/github-mcp-server/v2/pkg/translations" "github.com/google/go-github/v92/github" "github.com/google/jsonschema-go/jsonschema" @@ -840,8 +842,11 @@ func TestAssignCopilotToIssue(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - t.Parallel() + + spy := &headerCaptureTransport{inner: tc.mockedClient.Transport} + tc.mockedClient.Transport = &transportpkg.GraphQLFeaturesTransport{Transport: spy} + // Setup client with mock client := githubv4.NewClient(tc.mockedClient) deps := BaseDeps{ @@ -859,6 +864,7 @@ func TestAssignCopilotToIssue(t *testing.T) { // Call handler result, err := handler(ctx, &request) require.NoError(t, err) + assert.NotContains(t, spy.captured.Get(headers.GraphQLFeaturesHeader), "issues_copilot_assignment_api_support") textContent := getTextResult(t, result) @@ -1524,6 +1530,8 @@ func TestAssignCopilotToIssueWithIntent(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() + spy := &headerCaptureTransport{inner: tc.mockedClient.Transport} + tc.mockedClient.Transport = &transportpkg.GraphQLFeaturesTransport{Transport: spy} client := githubv4.NewClient(tc.mockedClient) deps := BaseDeps{GQLClient: client} handler := serverTool.Handler(deps) @@ -1536,6 +1544,7 @@ func TestAssignCopilotToIssueWithIntent(t *testing.T) { result, err := handler(ctx, &request) require.NoError(t, err) + assert.NotContains(t, spy.captured.Get(headers.GraphQLFeaturesHeader), "issues_copilot_assignment_api_support") textContent := getTextResult(t, result) diff --git a/pkg/http/transport/graphql_features_test.go b/pkg/http/transport/graphql_features_test.go index d4c3b74ce5..b1f7bbbea9 100644 --- a/pkg/http/transport/graphql_features_test.go +++ b/pkg/http/transport/graphql_features_test.go @@ -30,8 +30,8 @@ func TestGraphQLFeaturesTransport(t *testing.T) { }, { name: "single feature in context", - features: []string{"issues_copilot_assignment_api_support"}, - expectedHeader: "issues_copilot_assignment_api_support", + features: []string{"example_feature"}, + expectedHeader: "example_feature", hasHeader: true, }, { From 76052cd0e4c5d329c0b1376fcbc26af4d72b7a27 Mon Sep 17 00:00:00 2001 From: Owen Niblock Date: Wed, 11 Nov 2026 09:27:49 +0000 Subject: [PATCH 2/2] Remove retired flag absence assertions Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a02aa600-dde0-4990-b8aa-30bd517fa826 --- pkg/github/copilot_test.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/github/copilot_test.go b/pkg/github/copilot_test.go index 6925a6d71c..7d7ecf9ac7 100644 --- a/pkg/github/copilot_test.go +++ b/pkg/github/copilot_test.go @@ -12,8 +12,6 @@ import ( "github.com/github/github-mcp-server/v2/internal/githubv4mock" "github.com/github/github-mcp-server/v2/internal/toolsnaps" - "github.com/github/github-mcp-server/v2/pkg/http/headers" - transportpkg "github.com/github/github-mcp-server/v2/pkg/http/transport" "github.com/github/github-mcp-server/v2/pkg/translations" "github.com/google/go-github/v92/github" "github.com/google/jsonschema-go/jsonschema" @@ -842,11 +840,8 @@ func TestAssignCopilotToIssue(t *testing.T) { for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - spy := &headerCaptureTransport{inner: tc.mockedClient.Transport} - tc.mockedClient.Transport = &transportpkg.GraphQLFeaturesTransport{Transport: spy} + t.Parallel() // Setup client with mock client := githubv4.NewClient(tc.mockedClient) deps := BaseDeps{ @@ -864,7 +859,6 @@ func TestAssignCopilotToIssue(t *testing.T) { // Call handler result, err := handler(ctx, &request) require.NoError(t, err) - assert.NotContains(t, spy.captured.Get(headers.GraphQLFeaturesHeader), "issues_copilot_assignment_api_support") textContent := getTextResult(t, result) @@ -1530,8 +1524,6 @@ func TestAssignCopilotToIssueWithIntent(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - spy := &headerCaptureTransport{inner: tc.mockedClient.Transport} - tc.mockedClient.Transport = &transportpkg.GraphQLFeaturesTransport{Transport: spy} client := githubv4.NewClient(tc.mockedClient) deps := BaseDeps{GQLClient: client} handler := serverTool.Handler(deps) @@ -1544,7 +1536,6 @@ func TestAssignCopilotToIssueWithIntent(t *testing.T) { result, err := handler(ctx, &request) require.NoError(t, err) - assert.NotContains(t, spy.captured.Get(headers.GraphQLFeaturesHeader), "issues_copilot_assignment_api_support") textContent := getTextResult(t, result)