Skip to content

Support type intent (rationale/confidence/suggestion) in issue write …#2663

Open
iulia-b wants to merge 1 commit into
iunia/rationale-issue-write-labelsfrom
iunia/rationale-issue-write-types
Open

Support type intent (rationale/confidence/suggestion) in issue write …#2663
iulia-b wants to merge 1 commit into
iunia/rationale-issue-write-labelsfrom
iunia/rationale-issue-write-types

Conversation

@iulia-b

@iulia-b iulia-b commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Extend the general issue_write tool so the type can be sent either as a plain string or as an object with optional rationale (<=280 chars), is_suggestion and confidence.

Summary

Add intent value for types in the MCP when updating an issue

image

Why

Fixes https://github.com/github/plan-track-agentic-toolkit/issues/350

What changed

  • issue_write tool now supports issue_type suggestions

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

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)

@iulia-b iulia-b marked this pull request as ready for review June 11, 2026 06:47
@iulia-b iulia-b requested a review from a team as a code owner June 11, 2026 06:47
Copilot AI review requested due to automatic review settings June 11, 2026 06:47

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 extends the issue_write MCP tool to accept an issue type either as a plain string or as an object that can carry “intent” metadata (rationale/confidence/is_suggestion), enabling type suggestions with optional reasoning when updating issues.

Changes:

  • Added a shared type schema for issue_write that supports string or an intent-carrying object, and wired update flows to send the object form on the wire when intent is present.
  • Generalized the “custom PATCH payload” path for issue updates to support intent overrides for both labels and type.
  • Updated tests, toolsnaps, and generated docs; enhanced docs generation to render oneOf union types as string|object.
Show a summary per file
File Description
README.md Updates the documented issue_write.type parameter type to string|object.
pkg/github/issues.go Adds issue_write type union schema + plumbing to send type intent via custom update payload.
pkg/github/issues_test.go Adds coverage for issue_write update behavior and validation errors for type intent.
pkg/github/issues_granular.go Introduces parseValueParamWithIntent; refactors granular type update to reuse shared intent parsing/payload.
pkg/github/granular_tools_test.go Aligns expected error text with shared intent validation (“rationale must be …”).
pkg/github/toolsnaps/update_issue_type.snap Updates snapshot to reflect shared intent property descriptions.
pkg/github/toolsnaps/issue_write.snap Updates snapshot for issue_write to show type as oneOf (string or intent object).
pkg/github/toolsnaps/issue_write_ff_remote_mcp_issue_fields.snap Same issue_write snapshot update for the feature-flagged variant.
docs/insiders-features.md Regenerates docs showing issue_write.type as string|object.
docs/feature-flags.md Regenerates docs showing issue_write.type as string|object and updated update_issue_type intent descriptions.
cmd/github-mcp-server/generate_docs.go Enhances doc generation to display oneOf unions as a|b in generated markdown.

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 0

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.

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 1

Comment on lines 270 to 288
// Get the type and description
switch prop.Type {
case "array":
switch {
case prop.Type == "array":
if prop.Items != nil {
typeStr = prop.Items.Type + "[]"
} else {
typeStr = "array"
}
case prop.Type == "" && len(prop.OneOf) > 0:
var branchTypes []string
for _, branch := range prop.OneOf {
if branch.Type != "" && !slices.Contains(branchTypes, branch.Type) {
branchTypes = append(branchTypes, branch.Type)
}
}
typeStr = strings.Join(branchTypes, "|")
default:
typeStr = prop.Type
}
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.

2 participants