Skip to content

Require issue-intent metadata for close/assignment tools by default, with per-tool opt-out#46014

Merged
pelikhan merged 14 commits into
mainfrom
copilot/require-rationale-confidence-tools
Jul 16, 2026
Merged

Require issue-intent metadata for close/assignment tools by default, with per-tool opt-out#46014
pelikhan merged 14 commits into
mainfrom
copilot/require-rationale-confidence-tools

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This extends issue-intent behavior to close_issue, assign_to_user, and assign_to_agent, aligning them with existing issue-intent-aware mutation tools. By default, generated schemas now require rationale and confidence; each tool can independently opt out via its own issue-intent: false setting.

  • Schema + tool-definition coverage

    • Added rationale, confidence, and suggest fields to static tool definitions for:
      • close_issue
      • assign_to_user
      • assign_to_agent
    • Updated validation config for the same tools to normalize and strip invalid optional intent metadata without rejecting legacy calls.
  • Per-tool configuration model (safe-outputs.<tool>.issue-intent)

    • Added issue-intent to per-safe-output base config (child of each safe output entry, not a global safe-outputs toggle).
    • Default behavior is enabled when unset.
    • Explicit issue-intent: false disables intent requirements and guidance for that tool only.
  • Dynamic MCP schema/description generation

    • tools_meta.required_field_additions now adds ["rationale", "confidence"] for enabled tools.
    • Dynamic tool description enhancer now appends/removes intent guidance based on each tool’s own issue_intent mode.
    • Included close_issue, assign_to_user, and assign_to_agent in dynamic intent guidance set.
  • Runtime handler behavior

    • Propagated issue_intent into handler configs for close/assign paths.
    • Handlers now pass normalized intent metadata + feature header only when enabled and metadata is present.
    • Disabled mode uses legacy behavior (no intent metadata/header), preserving GHES compatibility and runtime leniency.
  • Type and test updates

    • Extended safe-output TS item typings so close/assign payloads can carry issue-intent metadata.
    • Added/updated focused tests for:
      • required field additions default vs opt-out
      • dynamic description suffix on/off per tool
      • runtime metadata/header emission in enabled mode
      • disabled mode legacy behavior
safe-outputs:
  close-issue:
    issue-intent: false
  assign-to-user:
    issue-intent: false
  assign-to-agent:
    issue-intent: false

Generated by 👨‍🍳 PR Sous Chef · 15.2 AIC · ⌖ 11.9 AIC · ⊞ 7.5K ·
Comment /souschef to run again

…assignment tools

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Extend issue-intent metadata for close and assignment tools Require issue-intent metadata for close/assignment tools by default, with per-tool opt-out Jul 16, 2026
Copilot AI requested a review from pelikhan July 16, 2026 15:03
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot intent is NOT required by default

Copilot AI and others added 2 commits July 16, 2026 15:09
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot intent is NOT required by default

Updated in fda3b45: issue-intent is no longer required by default. Rationale/confidence requirements and INTENT suffix are now opt-in (issue-intent: true) per tool.

@pelikhan
pelikhan marked this pull request as ready for review July 16, 2026 15:45
Copilot AI review requested due to automatic review settings July 16, 2026 15:45

Copilot AI left a comment

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.

Pull request overview

Extends safe-output issue-intent metadata to close and assignment tools across schema generation, runtime handlers, typings, tests, and compiled workflows.

Changes:

  • Adds rationale, confidence, and suggest fields.
  • Introduces per-tool issue-intent configuration.
  • Propagates metadata through close and assignment handlers.
Show a summary per file
File Description
pkg/workflow/safe_outputs_validation_config.go Adds intent validation fields.
pkg/workflow/safe_outputs_tools_generation.go Generates required intent fields.
pkg/workflow/safe_outputs_tools_generation_test.go Tests required-field generation.
pkg/workflow/safe_outputs_handler_registry.go Serializes intent configuration.
pkg/workflow/safe_outputs_config_types.go Defines the per-tool option.
pkg/workflow/safe_output_validation_config_test.go Expands validation tests.
pkg/workflow/js/safe_outputs_tools.json Updates static tool schemas.
actions/setup/js/types/safe-outputs.d.ts Extends safe-output typings.
actions/setup/js/safe_outputs_tools.json Updates runtime tool schemas.
actions/setup/js/generate_safe_outputs_tools.test.cjs Tests dynamic descriptions.
actions/setup/js/generate_safe_outputs_tools.cjs Applies intent guidance.
actions/setup/js/close_issue.test.cjs Tests close metadata behavior.
actions/setup/js/close_issue.cjs Sends close intent metadata.
actions/setup/js/assign_to_user.test.cjs Tests user-assignment metadata.
actions/setup/js/assign_to_user.cjs Sends assignment metadata.
actions/setup/js/assign_to_agent.cjs Propagates agent-assignment metadata.
actions/setup/js/assign_agent_helpers.test.cjs Tests agent helper metadata.
actions/setup/js/assign_agent_helpers.cjs Sends agent intent metadata.
.github/workflows/workflow-generator.lock.yml Recompiles assignment schema.
.github/workflows/smoke-copilot.lock.yml Recompiles intent requirements.
.github/workflows/smoke-copilot-aoai-entra.lock.yml Recompiles intent requirements.
.github/workflows/smoke-copilot-aoai-apikey.lock.yml Recompiles intent requirements.
.github/workflows/smoke-codex.lock.yml Recompiles intent requirements.
.github/workflows/smoke-agent-public-approved.lock.yml Recompiles assignment schema.
.github/workflows/semantic-function-refactor.lock.yml Recompiles close schema.
.github/workflows/objective-impact-report.lock.yml Recompiles close schema.
.github/workflows/lint-monster.lock.yml Recompiles close/assignment schemas.
.github/workflows/issue-monster.lock.yml Recompiles assignment schema.
.github/workflows/eslint-monster.lock.yml Recompiles close/assignment schemas.
.github/workflows/dependabot-go-checker.lock.yml Recompiles close schema.
.github/workflows/daily-assign-issue-to-user.lock.yml Recompiles user-assignment schema.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 30/31 changed files
  • Comments generated: 6
  • Review effort level: Medium

GitHubToken string `yaml:"github-token,omitempty"` // GitHub token for this specific output type
GitHubApp *GitHubAppConfig `yaml:"github-app,omitempty"` // GitHub App credentials for minting a per-handler installation access token
Staged *TemplatableBool `yaml:"staged,omitempty"` // Templatable preview-only mode for this specific output type
IssueIntent *bool `yaml:"issue-intent,omitempty"` // When true, enable issue-intent rationale/confidence guidance and schema requirements for this output type.

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.

Fixed in e41a65c: issue-intent is now accepted in main_workflow_schema.json for close-issue, assign-to-user, and assign-to-agent, and covered by schema tests.

Comment on lines +276 to +278
func issueIntentRequired(issueIntent *bool) bool {
return issueIntent != nil && *issueIntent
}

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.

Addressed in 739c45a: behavior is now maintainer-aligned — unset issue_intent keeps intent fields optional, true makes them required, and false omits them.

Comment on lines +52 to +57
function isIssueIntentEnabledForTool(toolName, toolConfig) {
if (!ISSUE_INTENT_TOOL_NAMES.has(toolName)) {
return false;
}
return !!(toolConfig && typeof toolConfig === "object" && "issue_intent" in toolConfig && toolConfig.issue_intent === true);
}

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.

Addressed in 739c45a: generator logic now models three states for intent fields (required/optional/absent) based on issue_intent value, with unset treated as optional.

AddTemplatableInt("max", c.Max).
AddStringSlice("allowed", c.Allowed).
AddStringSlice("blocked", c.Blocked).
AddBoolPtr("issue_intent", c.IssueIntent).

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.

Fixed in e41a65c: add_labels.cjs now honors config.issue_intent; metadata normalization/forwarding happens only when explicitly enabled.

config := newHandlerConfigBuilder().
AddTemplatableInt("max", c.Max).
AddStringSlice("allowed", c.Allowed).
AddBoolPtr("issue_intent", c.IssueIntent).

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.

Fixed in e41a65c (with header cleanup in 739c45a): set_issue_type.cjs now reads config.issue_intent and uses legacy behavior when disabled.

config := newHandlerConfigBuilder().
AddTemplatableInt("max", c.Max).
AddStringSlice("allowed_fields", c.AllowedFields).
AddBoolPtr("issue_intent", c.IssueIntent).

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.

Fixed in e41a65c (with follow-up 326a94d/739c45a): set_issue_field.cjs now gates issue-intent metadata on config.issue_intent and keeps legacy behavior when disabled.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot run pr-finisher skill

Done. I ran the PR-finisher flow, triaged reviews/checks/mergeability, and pushed fix 89813ab to address the failing JS typecheck (close_issue.cjs TS1016).

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

Failed checks:

Generated by 👨‍🍳 PR Sous Chef · 9.89 AIC · ⌖ 7.32 AIC · ⊞ 5.1K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Copilot AI and others added 3 commits July 16, 2026 17:57
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  • query graphql feature flag is not needed anymore...

Addressed in 739c45a (plus follow-ups 326a94d, bf829dc). I removed the GraphQL-Features: update_issue_suggestions header injection from the issue-intent runtime paths touched here, and updated MCP tool generation so intent fields are:

  • required when issue_intent: true
  • optional when issue_intent is unset
  • absent when issue_intent: false

Focused tests were updated and passing for the modified handlers/schema generator.

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address the unresolved review feedback below, and rerun checks once the branch is up to date.

Unresolved review threads:...

Completed.

  • Replied on all six unresolved review threads and mapped each to the fixing commits (e41a65c, 739c45a, 326a94d).
  • Verified the previously failing checks are green on the latest CJS rerun (29522085612, run attempt 2): js-typecheck and impacted-js-tests both passed.
  • Re-triaged PR state: mergeable is now clean.

Note: local full-suite targets (make test-unit / make test) still report unrelated pre-existing pkg/cli failures in this environment (hostname/timeout-sensitive tests), while targeted issue-intent Go/JS tests and JS typecheck pass.

@pelikhan
pelikhan merged commit 813bbd0 into main Jul 16, 2026
38 checks passed
@pelikhan
pelikhan deleted the copilot/require-rationale-confidence-tools branch July 16, 2026 18:51
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require rationale/confidence for close and assignment tools with an issue-intents opt-out

4 participants