feat: add include_patch parameter to get_commit tool#1924
Open
voki-gandzhelashvili-t wants to merge 1 commit intogithub:mainfrom
Open
feat: add include_patch parameter to get_commit tool#1924voki-gandzhelashvili-t wants to merge 1 commit intogithub:mainfrom
voki-gandzhelashvili-t wants to merge 1 commit intogithub:mainfrom
Conversation
Add a new optional parameter `include_patch` (default: false) to the get_commit tool that controls whether the patch/diff content is included for each file in the response. This is a non-breaking change: - Existing behavior is preserved (patch not included by default) - Users can opt-in by setting include_patch: true - Only applies when include_diff is also true Changes: - Added `Patch` field to MinimalCommitFile struct - Added `include_patch` parameter to get_commit tool schema - Updated convertToMinimalCommit to accept includePatch parameter - Patch content is only included when explicitly requested Use case: AI agents and code review tools that need to analyze actual code changes without additional API calls.
df0c3db to
5d9c352
Compare
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.
Summary
This PR adds a new optional parameter
include_patchto theget_committool, allowing users to optionally include the patch/diff content for each file in the response.Key Design Decision: Opt-in Behavior
The patch content is not included by default (
include_patch: false). This is intentional:Changes
Patch stringfield toMinimalCommitFilestructinclude_patchboolean parameter toget_committool (default:false)convertToMinimalCommitfunction to conditionally include patch contentUsage
Example Response with include_patch: true
{ "sha": "abc123...", "files": [{ "filename": "src/example.go", "status": "modified", "additions": 5, "deletions": 2, "changes": 7, "patch": "@@ -10,6 +10,9 @@\n func example() {\n+ // new code\n+ return true\n }" }] }Use Cases
Test Plan