Add rationale and confidence to closing an issue#2802
Draft
iulia-b wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the granular update_issue_state tool to support “close issue” intent metadata (rationale, confidence, and suggestion semantics) and adds support for closing as a duplicate by resolving an issue number to a database ID for duplicate_issue_id.
Changes:
- Reworks
update_issue_stateinto a standalone tool handler so it can send either the standard REST body or an object-formstatepayload with intent metadata. - Adds new optional parameters:
rationale,confidence,is_suggestion, andduplicate_of(with lookup toduplicate_issue_id). - Updates tests, tool schema snapshot, and feature-flag documentation for the new parameters.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/issues_granular.go | Implements object-form state update payload (intent metadata) and duplicate resolution flow for update_issue_state. |
| pkg/github/granular_tools_test.go | Adds coverage for suggestion mode, duplicate handling, and validation errors for the updated tool behavior. |
| pkg/github/toolsnaps/update_issue_state.snap | Updates the tool snapshot to reflect new schema fields and updated description. |
| docs/feature-flags.md | Documents the new update_issue_state parameters for feature-flagged granular issues tools. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+744
to
+748
| stateReason, err := OptionalParam[string](args, "state_reason") | ||
| if err != nil { | ||
| return utils.NewToolResultError(err.Error()), nil, nil | ||
| } | ||
| rationale, err := OptionalParam[string](args, "rationale") |
| - **update_issue_state** - Update Issue State | ||
| - **Required OAuth Scopes**: `repo` | ||
| - `confidence`: How confident you are in this choice. Use 'HIGH' for clear signal or explicit user request, 'MEDIUM' for reasonable inference with some ambiguity, 'LOW' for best guess with limited signal. (string, optional) | ||
| - `duplicate_of`: The issue number this issue is a duplicate of. Only valid when state_reason is 'duplicate' and is_suggestion is true. (number, optional) |
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
Similar to fields and type, this PR adds the ability of suggesting a "close issue" intent, with confidence, rationale, and support for duplicate issue .
Why
Fixes https://github.com/github/plan-track-agentic-toolkit/issues/343
What changed
update_issue_statetool as a standalone function (off the issueUpdateTool helper)MCP impact
Prompts tested (tool changes only)
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: 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
./script/lint./script/testDocs