modelcontextprotocol / modelcontextprotocol/python-sdk
Deeply-nested-body test fails on macOS: rejected as INVALID_REQUEST (-32600) instead of PARSE_ERROR (-32700)
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 24.3k
- 派生
- 4k
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 31
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 tests/server/test_streamable_http_modern.py::test_modern_post_with_deeply_nested_body_is_parse_error_not_a_crash 开始,并在 macOS 和另一个平台上运行提供的 uv pytest 命令。跟踪 RecursionError 在哪里被分类,并比较得到的 JSON-RPC 代码。完成的标准是理解特定于平台的行为,并且测试对预期解析错误的处理保持一致且不会崩溃。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- macos, python
- 领域
- operating-systems, testing-qa
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100