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

Aberta Para iniciantes
#3,960 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
62/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
go
Domínio
api, tooling

Direção de pesquisa

Comece localizando os esquemas de campos de list_issues e search_issues e o erro de validação que informa os campos aceitos. Compare as listas de campos permitidos e, em seguida, confira os testes existentes de cada ferramenta. Adicione uma verificação para garantir que os conjuntos de campos permaneçam sincronizados. O trabalho estará concluído quando ambas aceitarem os campos compartilhados, incluindo html_url, e os testes cobrirem os esquemas correspondentes.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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"
Linguagem predominante
Go
Estrelas
34.8k
Forks
5.4k
Merge médio
3d 22h
PRs com merge (30d)
31

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/github-mcp-server

Todas as issues de github/github-mcp-server

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.