Send update_issue_suggestions feature flag for set_issue_fields mutation#2638
Send update_issue_suggestions feature flag for set_issue_fields mutation#2638boazreicher wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ensures the set_issue_fields granular tool can use the rationale and suggest inputs by opting into GitHub’s update_issue_suggestions GraphQL feature flag on the setIssueFieldValue mutation request (via the GraphQL-Features header), aligning the MCP server’s outbound GraphQL behavior with the API’s feature-gated schema.
Changes:
- Wrap the
setIssueFieldValuemutation call inGranularSetIssueFieldswith a context that enablesupdate_issue_suggestions. - Add a transport-chain test that asserts the outbound mutation request includes
GraphQL-Features: update_issue_suggestions.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues_granular.go | Sets a GraphQL feature-flagged context for the setIssueFieldValue mutation so rationale/suggest inputs are accepted. |
| pkg/github/granular_tools_test.go | Adds a production-like transport-chain test to verify the GraphQL-Features header is emitted on the mutation request. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
|
boazreicher/add-suggestions-and-rationale-to-issue-fields |
The GitHub GraphQL API does not yet accept the per-field confidence input on setIssueFieldValue mutations. Hide it from the user-facing schema and drop it from the mutation payload unless the new update_issue_confidence feature flag is enabled so users do not try to use it before the API supports it.
| if deps.IsFeatureEnabled(ctx, FeatureFlagIssueConfidence) { | ||
| confidence, err := OptionalParam[string](fieldMap, "confidence") | ||
| if err != nil { | ||
| return utils.NewToolResultError(err.Error()), nil, nil | ||
| } | ||
| if confidence != "" && confidence != "low" && confidence != "medium" && confidence != "high" { | ||
| return utils.NewToolResultError("confidence must be one of: low, medium, high"), nil, nil | ||
| } | ||
| if confidence != "" { | ||
| input.Confidence = &confidence | ||
| } |
There was a problem hiding this comment.
Without the confidence param in the input schema, it's unlikely models will call this with the confidence parameter. I'm not seeing where this is conditionally hidden in the schema (I don't think theres currently a mechanism do that), rather it's just removed?
|
Great catch! You're right—the I've now added it back. Since the backend now supports Changes made:
All tests and linting pass. Models will now see and can supply the (posted by AI) |
Summary
Gate the
set_issue_fieldsGraphQL mutation behind theupdate_issue_suggestionsfeature flag so therationaleandsuggestinput fields are accepted by the API.Why
The
rationaleandsuggestinput fields onIssueFieldCreateOrUpdateInputare only available when theupdate_issue_suggestionsGraphQL feature flag is enabled. Without it, mutations using those inputs are rejected.What changed
pkg/github/issues_granular.go: Wrap thesetIssueFieldValuemutation context withghcontext.WithGraphQLFeatures("update_issue_suggestions")so the existingGraphQLFeaturesTransportemits the appropriateGraphQL-Featuresheader.pkg/github/granular_tools_test.go: Add a test that builds the production transport chain and asserts the mutation request carries theupdate_issue_suggestionsfeature flag header.MCP impact
The tool schema is unchanged; only the outbound GraphQL request headers are affected.
Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs