list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)

Đang mở Phù hợp với người mới
#3,960 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
api, tooling

Hướng nghiên cứu

Bắt đầu bằng cách xác định các lược đồ trường của list_issues và search_issues, cùng lỗi xác thực cho biết các trường được chấp nhận. So sánh danh sách trường được phép của chúng, rồi kiểm tra các bài kiểm thử hiện có cho từng công cụ. Thêm một bước kiểm tra để bảo đảm các tập trường luôn đồng bộ. Hoàn tất khi cả hai chấp nhận các trường dùng chung, bao gồm html_url, và các bài kiểm thử bao quát những lược đồ tương ứng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
  1. Call search_issues with fields: ["number","title","state","html_url"].
  2. Observe success and html_url in the results.
  3. Call list_issues with the same fields.
  4. 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 fields argument for both calls.
  • "Build a release-notes table with issue links from either a list or a search."
  • "Switch from search_issues to list_issues when 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"
Ngôn ngữ chính
Go
Star
34.8k
Fork
5.4k
Merge trung bình
3 ngày 22 giờ
Pull request đã merge (30 ngày)
31

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/github-mcp-server

Tất cả issue của github/github-mcp-server

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.