Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

pull_request_read get_files always returns full patches

未关闭
#3,236 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
go
领域
api

调研方向

从 get_files 方法的 pull_request_read 入口点开始,检查当前无条件填充 MinimalPRFile.Patch 的 convertToMinimalPRFiles。比较现有的字段选择机制 listPullRequestsItemFieldEnum 和 listCommitsItemFieldEnum,然后确认调用方可以请求不含补丁的文件元数据,并且默认行为仍然清晰。

由索引模型根据 Issue 内容生成。

描述

bug llm-context-window performance
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
  1. Call pull_request_read with method: get_files for a pull request touching a reasonable number of files.
  2. 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。