Skip to content

Commit 4e6e6c0

Browse files
Remove thread_resolution_reason feature flag (#3727)
* Remove thread_resolution_reason feature flag The flag is globally enabled, so resolution reasons are now always available on pull_request_review_write and resolve_review_thread. GHES still omits the resolutionReason input because it does not support it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Send resolution reasons as GraphQL enum values The resolveReviewThread mutation expects ADDRESSED, WONT_FIX or INVALID, but the tools forwarded the lowercase input values unchanged. Map them to enum names and treat an empty reason as none. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Remove stale resolution-reason variant comment Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Drop unrelated comment and test-name changes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Advertise resolution reasons as a schema enum Empty reasons are still accepted and treated as none. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Annie Gesellchen <10727170+cagesellchen@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 67d4dc4 commit 4e6e6c0

17 files changed

Lines changed: 94 additions & 319 deletions

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,7 @@ For negotiated supported protocol versions `2026-07-28` or newer, the consolidat
13711371
- `owner`: Repository owner (string, required)
13721372
- `pullNumber`: Pull request number (number, required)
13731373
- `repo`: Repository name (string, required)
1374+
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
13741375
- `threadId`: The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments. (string, optional)
13751376

13761377
- **search_pull_requests** - Search pull requests

‎docs/feature-flags.md‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ as output formatting) won't appear here.
404404

405405
- **resolve_review_thread** - Resolve Review Thread
406406
- **OAuth Challenge Scopes**: `repo`
407+
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
407408
- `threadID`: The node ID of the review thread to resolve (e.g., PRRT_kwDOxxx) (string, required)
408409

409410
- **submit_pending_pull_request_review** - Submit Pending Pull Request Review
@@ -629,18 +630,4 @@ as output formatting) won't appear here.
629630
- `perPage`: Results per page for pagination (min 0, max 100). Zero is forwarded for the GitHub API default. (number, optional)
630631
- `repo`: The name of the repository (string, required)
631632

632-
### `thread_resolution_reason`
633-
634-
- **pull_request_review_write** - Write operations (create, submit, delete) on pull request reviews
635-
- **OAuth Challenge Scopes**: `repo`
636-
- `body`: Review comment text (string, optional)
637-
- `commitID`: SHA of commit to review (string, optional)
638-
- `event`: Review action to perform. (string, optional)
639-
- `method`: The write operation to perform on pull request review. (string, required)
640-
- `owner`: Repository owner (string, required)
641-
- `pullNumber`: Pull request number (number, required)
642-
- `repo`: Repository name (string, required)
643-
- `resolutionReason`: Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid. (string, optional)
644-
- `threadId`: The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments. (string, optional)
645-
646633
<!-- END AUTOMATED FEATURE FLAG TOOLS -->

‎pkg/github/__toolsnaps__/pull_request_review_write.snap‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@
4747
"description": "Repository name",
4848
"type": "string"
4949
},
50+
"resolutionReason": {
51+
"description": "Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid.",
52+
"enum": [
53+
"addressed",
54+
"wont-fix",
55+
"invalid"
56+
],
57+
"type": "string"
58+
},
5059
"threadId": {
5160
"description": "The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments.",
5261
"type": "string"

‎pkg/github/__toolsnaps__/pull_request_review_write_resolution_reason.snap‎

Lines changed: 0 additions & 81 deletions
This file was deleted.

‎pkg/github/__toolsnaps__/resolve_review_thread.snap‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@
2121
],
2222
"inputSchema": {
2323
"properties": {
24+
"resolutionReason": {
25+
"description": "Optional reason for resolving a Copilot code review thread: addressed, wont-fix, or invalid.",
26+
"enum": [
27+
"addressed",
28+
"wont-fix",
29+
"invalid"
30+
],
31+
"type": "string"
32+
},
2433
"threadID": {
2534
"description": "The node ID of the review thread to resolve (e.g., PRRT_kwDOxxx)",
2635
"type": "string"

‎pkg/github/__toolsnaps__/resolve_review_thread_resolution_reason.snap‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎pkg/github/consolidated_pull_request_types.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ func normalizePullRequestReviewWriteArguments(raw json.RawMessage) (json.RawMess
598598
"method": params.Method, "owner": params.Owner, "repo": params.Repo, "pullNumber": params.PullNumber,
599599
}
600600
// Empty optional strings are equivalent to omitted ones for the handler,
601-
// but would fail the schema's enum for event.
601+
// but would fail the schema's enums for event and resolutionReason.
602602
for key, value := range map[string]string{"body": params.Body, "event": params.Event, "threadId": params.ThreadID} {
603603
if value != "" {
604604
canonical[key] = value
@@ -607,7 +607,7 @@ func normalizePullRequestReviewWriteArguments(raw json.RawMessage) (json.RawMess
607607
if params.CommitID != nil {
608608
canonical["commitID"] = *params.CommitID
609609
}
610-
if params.ResolutionReason != nil {
610+
if params.ResolutionReason != nil && *params.ResolutionReason != "" {
611611
canonical["resolutionReason"] = *params.ResolutionReason
612612
}
613613
for key := range args {

‎pkg/github/feature_flags.go‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ const FeatureFlagAgentAutomations = "agent_automations"
4242
// opt-in.
4343
const FeatureFlagDuplicateDetection = "duplicate_detection"
4444

45-
// FeatureFlagThreadResolutionReason exposes resolution reasons for Copilot review threads.
46-
const FeatureFlagThreadResolutionReason = "thread_resolution_reason"
47-
4845
// FeatureFlagSkillsExtension replaces server instructions with MCP-served skills.
4946
const FeatureFlagSkillsExtension = "skills"
5047

@@ -64,7 +61,6 @@ var AllowedFeatureFlags = []string{
6461
FeatureFlagIssueArtifacts,
6562
FeatureFlagAgentAutomations,
6663
FeatureFlagDuplicateDetection,
67-
FeatureFlagThreadResolutionReason,
6864
FeatureFlagSkillsExtension,
6965
}
7066

‎pkg/github/feature_flags_test.go‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,6 @@ func TestResolveFeatureFlags(t *testing.T) {
201201
insidersMode: false,
202202
expectedFlags: []string{FeatureFlagIssuesGranular},
203203
},
204-
{
205-
name: "thread resolution reason can be directly enabled",
206-
enabledFeatures: []string{FeatureFlagThreadResolutionReason},
207-
expectedFlags: []string{FeatureFlagThreadResolutionReason},
208-
},
209204
{
210205
name: "agent automations can be directly enabled",
211206
enabledFeatures: []string{FeatureFlagAgentAutomations},
@@ -253,36 +248,25 @@ func TestThreadResolutionReasonToolVariants(t *testing.T) {
253248
toolName string
254249
hasReason bool
255250
}{
256-
{
257-
name: "consolidated flag off",
258-
toolName: "pull_request_review_write",
259-
},
260251
{
261252
name: "consolidated flag on",
262-
flags: []inventory.FeatureFlag{FeatureFlagThreadResolutionReason},
263253
toolName: "pull_request_review_write",
264254
hasReason: true,
265255
},
266-
{
267-
name: "granular flag off",
268-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
269-
toolName: "resolve_review_thread",
270-
},
271256
{
272257
name: "granular flag on",
273-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular), FeatureFlagThreadResolutionReason},
258+
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
274259
toolName: "resolve_review_thread",
275260
hasReason: true,
276261
},
277262
{
278263
name: "consolidated flag on GHES",
279-
flags: []inventory.FeatureFlag{FeatureFlagThreadResolutionReason},
280264
host: utils.HostTypeGHES,
281265
toolName: "pull_request_review_write",
282266
},
283267
{
284268
name: "granular flag on GHES",
285-
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular), FeatureFlagThreadResolutionReason},
269+
flags: []inventory.FeatureFlag{inventory.FeatureFlag(FeatureFlagPullRequestsGranular)},
286270
host: utils.HostTypeGHES,
287271
toolName: "resolve_review_thread",
288272
},

‎pkg/github/granular_pull_request_types.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ func normalizeGranularPullRequestFields(args map[string]any, kind string) error
208208
return err
209209
}
210210
if kind == "resolve_reason" {
211-
_, _, err := OptionalParamOK[string](args, "resolutionReason")
211+
reason, _, err := OptionalParamOK[string](args, "resolutionReason")
212+
if reason == "" {
213+
// An empty reason means none and would fail the schema's enum.
214+
delete(args, "resolutionReason")
215+
}
212216
return err
213217
}
214218
delete(args, "resolutionReason")

0 commit comments

Comments
 (0)