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.
-
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
-
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
-
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)
-
Validator (safe_output_type_validator.cjs): Add validation rules for the new optional fields on these tools
Reference
Summary
Extend the issue-intent treatment (INTENT description suffix + rationale/confidence fields) to the
close_issue,assign_to_user, andassign_to_agentsafe-output tools, matching what's already in place forset_issue_type,set_issue_field, andadd_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:
Scope
Tools to update
close_issueassign_to_userassign_to_agentChanges required
Tool schema (
safe_outputs_tools.json): Add optionalrationale(string, maxLength 280) andconfidence(enum: LOW, MEDIUM, HIGH) fields toclose_issue,assign_to_user, andassign_to_agentinput schemasINTENT suffix (
generate_safe_outputs_tools.cjs): Extend theissue_intentsfeature gate list to includeclose_issue,assign_to_user, andassign_to_agentHandlers (
close_issue.cjs,assign_to_user.cjs,assign_to_agent.cjs): Pass intent metadata through to the API when theissue_intentsruntime feature is enabled (same pattern asset_issue_type.cjs)Validator (
safe_output_type_validator.cjs): Add validation rules for the new optional fields on these toolsReference
set_issue_type,set_issue_field,add_labels