Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

When agents report missing tools, automatically create or update GitHub issues to track remediation work.

Changes

Configuration

  • Added create-issue (default: true), title-prefix (default: "[missing tool]"), and labels fields to missing-tool safe output config
  • Auto-enabled missing-tool (when safe-outputs exists) now has create-issue: false to avoid unexpected issue creation
  • Updated JSON schema with new fields

Issue Management

  • Searches for existing open issues by title prefix + workflow name
  • Creates new issue with agentic task description if not found, referencing debug-agentic-workflow agent
  • Adds comment to existing issue with run link if found
  • Automatically grants issues:write permission when enabled
  • Issues expire automatically after 1 week - Created issues include an expiration marker that allows the close-expired-issues workflow to automatically close them

Architecture

  • Uses safe outputs handler pattern - Issue creation is now handled by a dedicated create_missing_tool_issue handler that processes messages from the agent output
  • The missing_tool.cjs step collects and reports missing tools, then outputs a create_missing_tool_issue message for the safe outputs handler
  • Registered create_missing_tool_issue handler in the safe output handler manager
  • Removed missing_tool from standalone step types to integrate with the handler pattern

Workflow Creation Guidance

  • Updated create-agentic-workflow.agent.md to recommend enabling missing-tool: create-issue: true for new workflows
  • Recommendation includes guidance to enable this feature when creating workflows, not when updating existing ones
  • Added to example workflow structure to demonstrate best practices

Example Configuration

safe-outputs:
  missing-tool:
    create-issue: true
    title-prefix: "[Tool Missing]"
    labels:
      - bug
      - needs-attention

To disable:

safe-outputs:
  missing-tool:
    create-issue: false

Test Fixes

  • Corrected test cases incorrectly passing trial mode flag to NewCompiler() verbose parameter
  • Added missing target-repo field to TestAddLabelsTargetRepoStagedBehavior
Original prompt

This section details on the original issue you should resolve

<issue_title>missing-tool create issue</issue_title>
<issue_description>Update m missing-tool to open an issue when the missing-tool safe output is called

  • add front matter field to disable feature

    safe-outputs:
    missing-tool:
    create-issue: false # disabled

  • add a javascript safe output handler to create issue

The logic to create or update an issue is as follows:

  • search for an opened issue with title "[missing tool] {workflow id}"
  • if no issue found, create new issue with an agentic task description that will allow copilot to fix the issue. Specify to use the "debug-agentic-workflow" agent when running copilot. Link the run and the workflow .md file.
  • if an opened issue is found, add a comment stating the tool is missing again with link to the run.

The front matter should also have options to change the title prefix, and add labels to the issue.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot update the create-agentic-workflow.agent.md prompt to recommend enabling this field when creating a new workflow (not on update)

@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot the created issue should expire after one week

Copilot AI changed the title [WIP] Update missing-tool to create issues on safe output Add automatic issue creation for missing-tool safe outputs Jan 6, 2026
Copilot AI requested a review from pelikhan January 6, 2026 15:16
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot the created issue should expire after one week

Done in 55c4724. Created issues now include an expiration marker <!-- gh-aw-expires: <ISO_DATE> --> set to 1 week (7 days) from creation. The existing close-expired-issues workflow will automatically close these issues when they expire.

@copilot update the create-agentic-workflow.agent.md prompt to recommend enabling this field when creating a new workflow (not on update)

Done in 55c4724. Updated the create-agentic-workflow.agent.md prompt to recommend enabling missing-tool: create-issue: true for new workflows. The recommendation is added in the safe-outputs section with guidance that this should be considered "when creating, not updating" workflows. Also added it to the example workflow structure.

}
}

async function main() {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot integrate this in the safe_outputs step using a handler instead of a standalone step

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in ad58ec7. Refactored to use the safe outputs handler pattern:

  1. Created new handler create_missing_tool_issue.cjs that processes messages from the agent output
  2. Registered the handler in safe_output_handler_manager.cjs and removed missing_tool from STANDALONE_STEP_TYPES
  3. Updated missing_tool.cjs to append a create_missing_tool_issue message to the agent output when create-issue is enabled
  4. Updated safe_outputs_config_generation.go to include the handler configuration with title_prefix and labels

The issue creation now flows through the safe outputs handler step instead of being executed inline in the missing_tool step.

Copilot AI requested a review from pelikhan January 6, 2026 16:09
@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 16:11
@pelikhan pelikhan merged commit 33e1b86 into main Jan 6, 2026
129 checks passed
@pelikhan pelikhan deleted the copilot/add-missing-tool-issue-handler branch January 6, 2026 16:11
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.

missing-tool create issue

2 participants