Commit c69aa55
committed
fix(server): send JSON-RPC parse error when stdio transport fails to parse message
When the stdio transport cannot parse an incoming JSON-RPC message
(e.g. deeply-nested JSON exceeding the recursion limit), the stdin_reader
sends a raw Exception through the read_stream. Previously, the session
only forwarded this Exception to the application layer via _handle_incoming,
never sending a JSON-RPC error response. The client request would hang
indefinitely waiting for a response that never arrived.
This aligns stdio behaviour with the Streamable HTTP transport, which
already returns a proper JSON-RPC parse error (code -32700) for
unparseable messages.
Fixes #2751
Signed-off-by: Willow Lopez <100782273+Oxygen56@users.noreply.github.com>1 parent 616476f commit c69aa55
1 file changed
Lines changed: 16 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
430 | 446 | | |
431 | 447 | | |
432 | 448 | | |
| |||
0 commit comments