fix: register close_pull_request in safe-outputs config.json#20894
Closed
Copilot wants to merge 4 commits into
Closed
fix: register close_pull_request in safe-outputs config.json#20894Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
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>
Copilot created this pull request from a session on behalf of
pelikhan
March 14, 2026 02:36
View session
pelikhan
approved these changes
Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close_pull_requestwas present inGH_AW_SAFE_OUTPUTS_HANDLER_CONFIGbut absent fromconfig.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 theClosePullRequestsbranch. Every peer safe-output (close_issue,close_discussion, etc.) had a corresponding entry;close_pull_requestwas simply never added.Changes
pkg/workflow/safe_outputs_config_generation.go— addclose_pull_requestblock afterclose_issue, usinggenerateTargetConfigWithReposwithrequired_labelsandrequired_title_prefixadditional fields (default max: 1), matching theclose_issuepattern exactly.pkg/workflow/safe_outputs_test.go— addclose-pull-request with required fieldstest case toTestGenerateSafeOutputsConfig.