modelcontextprotocol / modelcontextprotocol/python-sdk
Deeply-nested-body test fails on macOS: rejected as INVALID_REQUEST (-32600) instead of PARSE_ERROR (-32700)
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 24.3k
- Fork
- 4k
- Merge medio
- 1g 1h
- PR unite (30g)
- 31
Descrizione
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
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da tests/server/test_streamable_http_modern.py::test_modern_post_with_deeply_nested_body_is_parse_error_not_a_crash ed esegui il comando uv pytest fornito su macOS e su un'altra piattaforma. Traccia il punto in cui RecursionError viene classificato e confronta i codici JSON-RPC risultanti. Il lavoro è completato quando il comportamento specifico della piattaforma è compreso e la gestione prevista dell'errore di parsing nel test è coerente e non causa un arresto anomalo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- macos, python
- Ambito
- operating-systems, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 58/100