Add per-label is_suggestion and rationale to issue_write#2656
Conversation
Extend the general issue_write tool so each label can be sent either as a plain name or as an object with optional rationale (<=280 chars) and is_suggestion. On update, labels with intent are sent in object form (mapping is_suggestion to suggest); the create path strips intent. Mirrors the granular update_issue_labels behavior.
alondahari
left a comment
There was a problem hiding this comment.
Looks good, just a comment about extensibility
| }, | ||
| "rationale": { | ||
| Type: "string", | ||
| Description: "One concise sentence explaining what specifically about the issue led you to choose this label. " + |
There was a problem hiding this comment.
Since the limit is 280, why do we want to say that it's limited to one sentance?
|
@iulia-b what about confidence arguments? |
Extract a shared valueIntent struct plus parseValueIntent and intent schema helpers so rationale/confidence/is_suggestion can be reused across written values (labels now; issue types and field values in a future PR). Add confidence to issue_write labels, reword the rationale description, and generalize the is_suggestion wording.
Replace the granular labels tool's inline rationale/confidence/is_suggestion parsing with the shared parseValueIntent helper, removing the duplicate parser. Behavior is unchanged except the over-length rationale error now uses the shared message.
| }, | ||
| { | ||
| "properties": { | ||
| "confidence": { |
There was a problem hiding this comment.
@boazreicher I added confidence with values low, medium and high, and without any optional param or anything special, just sending it to the server
| {Type: "string", Description: "Label name"}, | ||
| { | ||
| Type: "object", | ||
| Properties: withIntentProperties(map[string]*jsonschema.Schema{ |
There was a problem hiding this comment.
@boazreicher @alondahari , I extracted the parser and also the intent related props in their own type, and using it to extend labels (and soon, types and field values) ; also using this in the issues_granular
|
|
||
| // HasIntent reports whether any intent metadata was supplied. | ||
| func (v valueIntent) HasIntent() bool { | ||
| return v.Rationale != "" || v.Confidence != "" || v.Suggest |
There was a problem hiding this comment.
@boazreicher is this valid or should it only be v.Suggest == true for HasIntent?
There was a problem hiding this comment.
Pull request overview
This PR extends the issue_write tool’s labels parameter to support per-label “intent” metadata (optional rationale and is_suggestion) by allowing each label entry to be either a plain string or an object, and updates the update path to preserve intent on the wire.
Changes:
- Updated
issue_writeJSON schema solabels[]supportsstringor{ name, rationale?, confidence?, is_suggestion? }. - Implemented update-time label intent propagation by sending a custom PATCH payload when intent is present.
- Refactored granular label update parsing/validation into shared helpers and updated toolsnaps/docs/tests accordingly.
Show a summary per file
| File | Description |
|---|---|
| README.md | Regenerated docs reflecting the updated issue_write labels parameter shape. |
| pkg/github/issues.go | Adds label intent support to issue_write, extends UpdateIssue with an intent-aware labels path. |
| pkg/github/issues_test.go | Adds coverage for issue_write update requests that include label intent and validation errors. |
| pkg/github/issues_granular.go | Introduces shared “intent” parsing/schema helpers and reuses them in granular label updates. |
| pkg/github/granular_tools_test.go | Updates expected error messages to match the new shared intent validation. |
| pkg/github/toolsnaps/issue_write.snap | Updates tool schema snapshot for new labels union type and intent properties. |
| pkg/github/toolsnaps/issue_write_ff_remote_mcp_issue_fields.snap | Same schema snapshot update for the feature-flagged variant. |
| docs/insiders-features.md | Regenerated docs reflecting schema change. |
| docs/feature-flags.md | Regenerated docs reflecting schema change. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 3
| Type: "array", | ||
| Description: "Labels to apply to this issue", | ||
| Items: &jsonschema.Schema{ |
| Type: "array", | ||
| Description: "Labels to apply to this issue", | ||
| Items: &jsonschema.Schema{ |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Extend the general issue_write tool so each label can be sent either as a plain name or as an object with optional rationale (<=280 chars) and is_suggestion. On update, labels with intent are sent in object form (mapping is_suggestion to suggest); the create path strips intent. Mirrors the granular update_issue_labels behavior.
Summary
Why
Fixes https://github.com/github/plan-track-agentic-toolkit/issues/349
What changed
issue_writetool now supports labels suggestionsMCP 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