Skip to content

Add intent metadata (rationale + confidence) to close_issue, assign_to_user, and assign_to_agent safe-output tools #43175

Description

@alondahari

Summary

Extend the issue-intent treatment (INTENT description suffix + rationale/confidence fields) to the close_issue, assign_to_user, and assign_to_agent safe-output tools, matching what's already in place for set_issue_type, set_issue_field, and add_labels.

Motivation

When an agent closes an issue or assigns someone, those decisions carry the same kind of reasoning as setting a type or applying labels. Capturing rationale and confidence for these actions provides:

  • Auditability: reviewers can understand why the agent closed an issue or assigned a specific user/agent
  • Consistency: all issue-mutation tools follow the same intent pattern
  • Future value: intent metadata can power suggest-mode UX for these actions too

Scope

Tools to update

Tool Example rationale
close_issue "Duplicate of #123 — same root cause confirmed in thread"
assign_to_user "User is CODEOWNER for the affected path and has capacity"
assign_to_agent "Issue requires code changes in auth module — delegating to Copilot"

Changes required

Note: All of the above should be gated behind the issue_intents runtime feature environment variable, consistent with the existing implementation for set_issue_type, set_issue_field, and add_labels.

  1. Tool schema (safe_outputs_tools.json): Add optional rationale (string, maxLength 280) and confidence (enum: LOW, MEDIUM, HIGH) fields to close_issue, assign_to_user, and assign_to_agent input schemas

  2. INTENT suffix (generate_safe_outputs_tools.cjs): Extend the issue_intents feature gate list to include close_issue, assign_to_user, and assign_to_agent

  3. Handlers (close_issue.cjs, assign_to_user.cjs, assign_to_agent.cjs): Pass intent metadata through to the API when the issue_intents runtime feature is enabled (same pattern as set_issue_type.cjs)

  4. Validator (safe_output_type_validator.cjs): Add validation rules for the new optional fields on these tools

Reference

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions