Repository navigation
test(relay): pin a 500-level JSON message round trip - #473
Merged
Merged
Conversation
#462 follow-up. CPython 3.10/3.11 parse up to 994 levels (the recursion limit); 3.12+ go far deeper. Real MCP messages stay within a few dozen levels. This pins 500 levels, the depth guaranteed to work on every supported Python, through both directions: the stdin request reaching upstream and the upstream result reaching stdout. The mock body is a string because pytest-httpx deep-copies a json= object, and copy.deepcopy hits the recursion limit at this depth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
AI review (gpt-6.1-sol)Verdict: no blocking findings. Scope: full PR diff. No findings clear the reporting bar this round. Advisory per-push review (round 1) generated by ai-review — verify findings before acting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #462.
#462's probe established how deep
json.loadsgoes before it raises. Measured on macOS:Deeper input becomes a per-message
RecursionError, never a crash. Real MCP messages stay within a few dozen levels.This adds one unit test,
TestDeepJsonMessage, which pins 500 levels, the depth guaranteed on every supported Python. It covers both directions:The mock response body is passed as a string, because pytest-httpx deep-copies a
json=object andcopy.deepcopyitself hits the recursion limit at this depth.The test runs in under a second, inside the existing suite. It passes locally on Python 3.10 through 3.14.
🤖 Generated with Claude Code