Instruct LLM to use pull request template when creating PRs#1442
Merged
almaleksia merged 2 commits intomainfrom Nov 19, 2025
Merged
Instruct LLM to use pull request template when creating PRs#1442almaleksia merged 2 commits intomainfrom
almaleksia merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the GitHub MCP Server by instructing LLMs to search for and use pull request templates when creating PRs. The instruction is conditionally added only when both the "pull_requests" and "repos" toolsets are enabled, ensuring the LLM has access to the necessary file retrieval tools.
Key Changes
- Modified
getToolsetInstructions()to accept anenabledToolsetsparameter for conditional instruction generation - Added new instruction text for pull request template discovery and usage when repos toolset is available
- Enhanced test coverage with assertions to verify the conditional template instruction behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/github/instructions.go | Updated function signature to accept enabled toolsets; added conditional logic to include PR template instructions when repos toolset is available |
| pkg/github/instructions_test.go | Added strings import; expanded test structure with fields for conditional assertions; added test cases to verify template instructions appear/disappear based on enabled toolsets |
Comments suppressed due to low confidence (1)
pkg/github/instructions_test.go:161
- The test cases for "issues", "discussions", and "nonexistent" toolsets are missing the
enabledToolsetsfield. SincegetToolsetInstructionsnow requires this parameter, these test cases should provide it (even if it's justnilor an empty slice[]string{}) to be explicit about the expected behavior and avoid potential issues if the function logic changes to use this parameter for these toolsets.
{
toolset: "issues",
expectedEmpty: false,
},
{
toolset: "discussions",
expectedEmpty: false,
},
{
toolset: "nonexistent",
expectedEmpty: true,
},
JoannaaKL
approved these changes
Nov 19, 2025
tonytrg
approved these changes
Nov 19, 2025
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.
Adds server instructions that tell LLM to search for PR templates and use them for creating PRs.
xref #1076