pull_request_read get_files always returns full patches
还没有人认领这个 Issue。
评估
调研方向
从 get_files 方法的 pull_request_read 入口点开始,检查当前无条件填充 MinimalPRFile.Patch 的 convertToMinimalPRFiles。比较现有的字段选择机制 listPullRequestsItemFieldEnum 和 listCommitsItemFieldEnum,然后确认调用方可以请求不含补丁的文件元数据,并且默认行为仍然清晰。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
pull_request_read with method: get_files always includes the full patch for every file, and offers no way to ask for filenames only. A 21-file pull request returned roughly 370 KB when only the paths were needed.
In the source, convertToMinimalPRFiles populates MinimalPRFile.Patch unconditionally, and get_files has no field-selection parameter. Several other tools do have one, for example listPullRequestsItemFieldEnum and listCommitsItemFieldEnum, so the mechanism already exists elsewhere in the codebase.
Affected version
Unknown. Observed through a hosted GitHub MCP integration on 2026-09-06, where the server version is not exposed to me. The code references above are from the repository's default branch on that date and may not match the build that was serving the request.
Steps to reproduce the behavior
- Call
pull_request_readwithmethod: get_filesfor a pull request touching a reasonable number of files. - Observe that every entry carries its full
patch, with no option to omit it.
Expected vs actual behavior
Expected: a way to request file metadata without patches, for example a fields parameter matching the pattern used by the list tools.
Actual: patches are always included, so a caller that only needs the list of changed paths pays the full diff in context.
Possibly related to #2122, which is closed but describes the same class of oversized pull_request_read payloads.
Logs
None captured beyond the returned payload size.
- 主要语言
- Go
- 星标
- 33.1k
- 派生
- 5k
- 平均合并
- 2 天 1 小时
- 30 天内合并 PR
- 25
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/github-mcp-server 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
github/github-mcp-server#3235 ·
-
enhancement
难度 1/5 1 小时以内 新手友好度 88/100
github/github-mcp-server#3042 · 2 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
github/github-mcp-server#3032 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 74/100
github/github-mcp-server#2803 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
github/github-mcp-server#2740 ·
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
area/dev-productivity area/disaster-recovery area/ipcei kind/enhancement
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
kind/bug status/0-triage
难度 2/5 1-3 小时 新手友好度 75/100
-
🤔 refinement needed
难度 2/5 1-3 小时 新手友好度 75/100
equinor/radix-operator#1979 ·