Skip to content

Migrate set_issue_fields tool payload to using new intent model#2678

Open
reneexeener wants to merge 8 commits into
mainfrom
reneexeener/use-update-intent-model
Open

Migrate set_issue_fields tool payload to using new intent model#2678
reneexeener wants to merge 8 commits into
mainfrom
reneexeener/use-update-intent-model

Conversation

@reneexeener

@reneexeener reneexeener commented Jun 12, 2026

Copy link
Copy Markdown

Summary

This PR adds a new feature flag, issue_fields_use_intent , and updates the issue field mutation logic to optionally send rationale and confidence as a nested update_intent object (instead of flat fields) when the flag is enabled, to support a backend schema migration.

Why

We're migrating to storing suggestions in a new DB table so the GraphQL schema will change for the set_issue_field_value mutation to accept an intent argument. These changes are needed to make sure this MCP tool works with the upcoming schema change.

What changed

This pull request introduces support for a new payload shape for issue field mutations, allowing rationale and confidence to be sent as a nested intent object (IssueUpdateIntent) instead of as flat fields. This is controlled by a new feature flag, enabling a smooth migration to the updated backend schema. The changes include the new feature flag, updates to the input struct, conditional logic for payload construction, and a comprehensive test.

Area Description Reference(s)
Feature Flag Added FeatureFlagIssueFieldsUseIntent to control use of nested intent object for rationale/confidence. pkg/github/feature_flags.goR19-R25
Data Structures Added Intent field to IssueFieldCreateOrUpdateInput and defined new IssueUpdateIntentInput struct. pkg/github/issues_granular.goR920-R932
Payload Logic Updated GranularSetIssueFields to conditionally send rationale/confidence as either flat fields or nested object based on the feature flag. [1] [2] [3] [4]
Testing Added a test case to verify rationale and confidence are sent as an intent object when the feature flag is enabled. pkg/github/granular_tools_test.goR1995-R2099

MCP impact

  • No tool or API changes
    • Only shape of the outgoing payload to the GraphQL mutation is changed
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

  • Tested locally against prod issue with FF on and off

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@reneexeener reneexeener changed the title Reneexeener/use update intent model Migrate set_issue_fields tool payload to using new intent model Jun 12, 2026
@reneexeener reneexeener marked this pull request as ready for review June 12, 2026 11:46
@reneexeener reneexeener requested a review from a team as a code owner June 12, 2026 11:46
Copilot AI review requested due to automatic review settings June 12, 2026 11:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new feature-flagged payload shape for the set_issue_fields GraphQL mutation, allowing rationale/confidence to be sent as a nested intent object to support an upcoming backend schema migration.

Changes:

  • Introduces IssueUpdateIntentInput and an Intent field on IssueFieldCreateOrUpdateInput.
  • Updates GranularSetIssueFields to conditionally send rationale/confidence via nested intent vs flat fields based on a feature flag.
  • Adds a unit test validating the nested intent payload when the feature flag is enabled.
Show a summary per file
File Description
pkg/github/issues_granular.go Adds nested intent input type and gates the outgoing mutation payload shape behind a feature flag.
pkg/github/granular_tools_test.go Adds a test case asserting the nested intent payload is used when the flag is enabled.
pkg/github/feature_flags.go Defines the new feature flag constant used to gate the payload shape.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment on lines +20 to +24
// rationale and confidence on issue field mutations as a nested `intent`
// object (IssueUpdateIntent) instead of as flat fields. It exists so the
// set_issue_fields tool can switch payload shapes while the backend migrates
// IssueFieldCreateOrUpdateInput from IssueEventRationale to IssueUpdateIntent.
const FeatureFlagIssueFieldsUseIntent = "issue_fields_use_intent"

@reneexeener reneexeener Jun 12, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional because this feature flag shouldn't be user-facing. The feature flag issue_fields_use_intent will be rolled out after the GraphQL mutation is updated.

Comment thread pkg/github/feature_flags.go

@frogfx frogfx left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check items before merge

  1. Add FF-disabled regression test
  2. Add partial/empty intent tests
  3. Clean up naming inconsistencies between PR text and code (update_intent vs intent, flag name mismatch if applicable)

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.

3 participants