modelcontextprotocol / modelcontextprotocol/python-sdk

Deeply-nested-body test fails on macOS: rejected as INVALID_REQUEST (-32600) instead of PARSE_ERROR (-32700)

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

Ninguém assumiu esta issue ainda.

bug P3 spec-2026-07-28 v2
Linguagem predominante
Python
Estrelas
24.3k
Forks
4k
Merge médio
1d 1h
PRs com merge (30d)
31

Descrição

Running the test suite on macOS (observed on GitHub macos-latest, Python 3.14) fails one test that passes on Ubuntu and Windows:

FAILED tests/server/test_streamable_http_modern.py::test_modern_post_with_deeply_nested_body_is_parse_error_not_a_crash
>       assert response.json()["error"]["code"] == PARSE_ERROR
E       assert -32600 == -32700

https://github.com/modelcontextprotocol/python-sdk/blob/3a6f2996cdd8358957479791e8b26198c07d6a75/tests/server/test_streamable_http_modern.py#L1011

The response status is 400 in both cases; only the JSON-RPC error code differs. The test expects the RecursionError raised while parsing the deeply nested body to classify as a parse error, but on Darwin it surfaces as INVALID_REQUEST, so the recursion limit is evidently being hit in a different layer there (macOS threads run with a smaller default stack, which moves where the recursion guard strikes).

This is unrelated to any open PR: it fails identically on current main (3a6f299) and on feature branches, reproduced across repeated runs on macos-latest. Repro:

uv sync --frozen
uv run --frozen pytest tests/server/test_streamable_http_modern.py::test_modern_post_with_deeply_nested_body_is_parse_error_not_a_crash

CI currently runs Ubuntu and Windows only, which is why this has gone unnoticed; worth deciding separately whether macos-latest should join the matrix.

AI Disclaimer

Guia de contribuição

Abrir o guia de contribuição

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.

Direção de pesquisa

Comece com tests/server/test_streamable_http_modern.py::test_modern_post_with_deeply_nested_body_is_parse_error_not_a_crash e execute o comando uv pytest fornecido no macOS e em outra plataforma. Rastreie onde RecursionError é classificado e compare os códigos JSON-RPC resultantes. Considera-se concluído quando o comportamento específico da plataforma estiver compreendido e o tratamento esperado do erro de parsing pelo teste for consistente sem causar um crash.

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

Avaliação

Stack de tecnologia
macos, python
Domínio
operating-systems, testing-qa
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Pouca atividade
Clareza
Razoavelmente clara
Facilidade para iniciantes
58/100

Receba novas issues na sua caixa de entrada

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