list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先找到 list_issues 和 search_issues 的字段模式,以及报告可接受字段的验证错误。比较它们的允许列表,然后检查每个工具现有的测试。添加一项检查,确保它们的字段集合保持同步。当两者都接受共同字段(包括 html_url),且测试覆盖相匹配的模式时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
list_issues and search_issues return the same kind of object but accept different fields allow-lists. In particular, html_url is accepted by search_issues and rejected by list_issues:
search_issues(fields: ["number","title","state","html_url"])succeeds.list_issues(fields: ["number","title","state","html_url"])fails with:
fields[3]: Expected "number" | "title" | "body" | "state" | "user" | "labels" | "assignees" | "comments" | "created_at" | "updated_at" | "field_values"
This forces callers to keep separate field lists for two tools that should be interchangeable, and it turns a simple "list or search, same projection" workflow into a retry. html_url is a standard, useful field (linking issues), so its absence from list_issues is surprising.
Steps to reproduce the behavior
- Call
search_issueswithfields: ["number","title","state","html_url"]. - Observe success and
html_urlin the results. - Call
list_issueswith the samefields. - Observe the invalid-arguments error above.
Expected vs actual behavior
Expected: both tools accept the same issue-field allow-list, including html_url, or share a single schema/type for issue projections.
Actual: the allow-lists diverge, and a field valid in one tool is invalid in the other.
Proposed solution
Define one shared issue-field schema used by list_issues, search_issues, and (with #3959) issue_read. Include at least:
number, title, state, state_reason, user.login, labels, assignees, milestone, comments, created_at, updated_at, closed_at, html_url, and opt-in body.
Return the allowed field list in validation errors, and add a test that the list/search field sets stay in sync.
Example prompts or workflows (for tools/toolsets only)
- "List the 30 newest issues with number, title, state, and URL; then run the same query as a search." — same
fieldsargument for both calls. - "Build a release-notes table with issue links from either a list or a search."
- "Switch from
search_issuestolist_issueswhen the search rate limit is hit, without rewriting the projection."
Additional context
Related: #3605 (inconsistent parameter names), #3286 (PR response field filtering), #3959 (issue_read field filtering), #2425 (schema descriptions), #2270 (closed: projects_list ignored fields).
Environment: OpenCode 2.4.1, hosted endpoint https://api.githubcopilot.com/mcp/, toolsets repos,issues,pull_requests,actions.
Logs
list_issues fields error:
fields[3]: Expected "number" | "title" | "body" | "state" | "user" | "labels" | "assignees" | "comments" | "created_at" | "updated_at" | "field_values"
- 主要语言
- Go
- 星标
- 34.8k
- 派生
- 5.4k
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 31
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/github-mcp-server 的其他 Issue
-
Scope-challenge middleware fails open when the token-scope fetch returns an error可能已有人在做 @Shanmukh-l33t 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
github/github-mcp-server#3929 ·
维护者通常 3 天内回复
-
ListLabelsOutput drops every label id from the typed response可能已有人在做 @Shanmukh-l33t 于 3 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
github/github-mcp-server#3923 · 1 个 reaction ·
维护者通常 3 天内回复
-
create_or_update_file rejects explicitly empty file content可能已有人在做 @Elon-Jiang 于 8 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
github/github-mcp-server#3883 ·
维护者通常 3 天内回复
-
csv_output silently overwrites distinct fields when flattened keys collide可能已有人在做 @Mystery01092000 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
github/github-mcp-server#3865 ·
维护者通常 3 天内回复
-
update_issue_labels is annotated destructiveHint: false but replaces (removes) existing labels可能已有人在做 @shhhhhhjokerist 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 69/100
github/github-mcp-server#3760 · 2 条评论 ·
维护者通常 3 天内回复
查看 github/github-mcp-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
JuliusBrussee/caveman#1594 ·
维护者通常 1 天内回复
-
C-bug O-community X-blathers-triaged
难度 2/5 1-3 小时 新手友好度 66/100
cockroachdb/cockroach#176264 · 1 条评论 ·
-
security trivy
难度 2/5 1-3 小时 新手友好度 67/100
kubefleet-dev/kubefleet#1068 ·
维护者通常 3 天内回复