Export GraphQLFeaturesTransport and WithGraphQLFeatures for remote server support#1809
Closed
Export GraphQLFeaturesTransport and WithGraphQLFeatures for remote server support#1809
Conversation
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GraphQL schema error in assign_copilot_to_issue
Export GraphQLFeaturesTransport for remote server GraphQL-Features header support
Jan 14, 2026
pkg/github/issues.go
Outdated
| // to read feature flags and add them as the "GraphQL-Features" header. | ||
| // | ||
| // For most use cases, use GraphQLFeaturesTransport instead of calling this directly. | ||
| func GetGraphQLFeatures(ctx context.Context) []string { |
Collaborator
There was a problem hiding this comment.
@copilot should we move all this GetGraphQLFeatures etc. to the transport file? It makes more sense there.
Contributor
Author
There was a problem hiding this comment.
Done! Moved graphQLFeaturesKey, withGraphQLFeatures, and GetGraphQLFeatures to transport.go where they logically belong with GraphQLFeaturesTransport. Commit: 7333546
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
pkg/github/transport.go
Outdated
| // withGraphQLFeatures adds GraphQL feature flags to the context. | ||
| // The flags are read by GraphQLFeaturesTransport and sent as the GraphQL-Features header. | ||
| // This is used internally by tool handlers that require experimental GitHub API features. | ||
| func withGraphQLFeatures(ctx context.Context, features ...string) context.Context { |
Collaborator
There was a problem hiding this comment.
@copilot export this please, so the remote server can use in tests.
Contributor
Author
There was a problem hiding this comment.
Exported! Renamed withGraphQLFeatures to WithGraphQLFeatures and updated all references. Remote server can now use it in tests to simulate feature flag contexts. Commit: 27ee7e4
Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot
AI
changed the title
Export GraphQLFeaturesTransport for remote server GraphQL-Features header support
Export GraphQLFeaturesTransport and WithGraphQLFeatures for remote server support
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remote server's HTTP transport doesn't read
GraphQL-Featuresfrom context, causingassign_copilot_to_issueto fail with schema validation errors. This PR extracts and exports a reusable transport and helper functions for both local and remote servers.Why
The
issues_copilot_assignment_api_supportfeature flag must be sent viaGraphQL-Featuresheader for Copilot assignment API. Remote server needs library support to implement this correctly and write tests.What changed
GraphQLFeaturesTransporttopkg/github/transport.goas reusable, exported typetransport.gofor better code organizationWithGraphQLFeaturesfunction to allow remote server to set feature flags in test contextsGetGraphQLFeaturesfunction to allow custom transports to read feature flags from contextDefaultTransport→bearerAuthTransport→GraphQLFeaturesTransportbearerAuthTransportMCP impact
assign_copilot_to_issuebehavior unchangedSecurity / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
Usage for remote server
Wrap GraphQL HTTP client with the exported transport:
In tests, use
WithGraphQLFeaturesto simulate feature flag contexts:Transport automatically reads feature flags from context via
GetGraphQLFeaturesand addsGraphQL-Featuresheader when present.Original prompt
assign_copilot_to_issuefails with GraphQL schema error:agentAssignmentfield not defined onUpdateIssueInput#1805💡 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.