Skip to content

fix: register close_pull_request in safe-outputs config.json#20894

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-close-pull-request-registration
Closed

fix: register close_pull_request in safe-outputs config.json#20894
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-close-pull-request-registration

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

close_pull_request was present in GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG but absent from config.json — the file the safe-outputs MCP server uses to decide which tools to register. Result: the tool was silently skipped at runtime despite being correctly configured in frontmatter.

Root cause

generateSafeOutputsConfig() (safe_outputs_config_generation.go) was missing the ClosePullRequests branch. Every peer safe-output (close_issue, close_discussion, etc.) had a corresponding entry; close_pull_request was simply never added.

Changes

  • pkg/workflow/safe_outputs_config_generation.go — add close_pull_request block after close_issue, using generateTargetConfigWithRepos with required_labels and required_title_prefix additional fields (default max: 1), matching the close_issue pattern exactly.
  • pkg/workflow/safe_outputs_test.go — add close-pull-request with required fields test case to TestGenerateSafeOutputsConfig.

Copilot AI and others added 3 commits March 13, 2026 22:29
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The close_pull_request safe-output was compiled into
GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG but missing from config.json,
causing the MCP server to skip registering the tool.

Added the missing ClosePullRequests handler in
generateSafeOutputsConfig() following the same pattern as close_issue.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan closed this Mar 14, 2026
@github-actions github-actions Bot deleted the copilot/fix-close-pull-request-registration branch April 2, 2026 13:05
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.

The agent cannot close PRs even though the frontmatter explicitly configures it.

2 participants