Skip to content

Add per-label is_suggestion and rationale to issue_write#2656

Draft
iulia-b wants to merge 4 commits into
mainfrom
iunia/rationale-issue-write-labels
Draft

Add per-label is_suggestion and rationale to issue_write#2656
iulia-b wants to merge 4 commits into
mainfrom
iunia/rationale-issue-write-labels

Conversation

@iulia-b

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

Copy link
Copy Markdown
Contributor

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_write tool now supports labels suggestions

MCP impact

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

Prompts tested (tool changes only)

  • "let's try using the other mcp server available, suggest label duplicate with rationale "this is a suggestion from the local server""
Screenshot 2026-06-09 at 18 16 28 image

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)

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
alondahari previously approved these changes Jun 9, 2026

@alondahari alondahari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just a comment about extensibility

Comment thread pkg/github/issues.go Outdated
Comment on lines +1878 to +1879
Description: "If true, this label is sent to the API as a suggestion rather than an applied label. " +
"Whether the label is applied or recorded as a proposal is determined by the API. Only honored when updating an existing issue.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Description: "If true, this label is sent to the API as a suggestion rather than an applied label. " +
"Whether the label is applied or recorded as a proposal is determined by the API. Only honored when updating an existing issue.",
Description: "If true, this label is sent to the API as a suggestion rather than an applied label. "

Is this second line needed?

Comment thread pkg/github/issues.go Outdated
Comment thread pkg/github/issues.go Outdated
},
"rationale": {
Type: "string",
Description: "One concise sentence explaining what specifically about the issue led you to choose this label. " +

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.

Since the limit is 280, why do we want to say that it's limited to one sentance?

@boazreicher

Copy link
Copy Markdown
Contributor

@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": {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@boazreicher I added confidence with values low, medium and high, and without any optional param or anything special, just sending it to the server

Comment thread pkg/github/issues.go
{Type: "string", Description: "Label name"},
{
Type: "object",
Properties: withIntentProperties(map[string]*jsonschema.Schema{

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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

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