Skip to content

JSON-RPC server returns -32603 instead of -32700 for a deeply nested body #1566

Description

@ConnorMoss02

A body nested deeper than the JSON decoder can handle makes request.json() raise RecursionError. The parse-error clause only catches JSONDecodeError and UnicodeDecodeError (server/routes/jsonrpc_dispatcher.py:343), so it falls through to -32603 Internal error with HTTP 200. REST already returns a 400 for the same body.

Activity

  1. added
    component: server
    on Dec 1, 2026
  2. added theissue type on Dec 1, 2026
  3. rohityan commented on Dec 1, 2026

    @rohityan

    Hi @ConnorMoss02, Thanks for reporting this and opening #1568.

    Your root-cause analysis is right: await request.json() in JsonRpcDispatcher.handle_requests() raises RecursionError on deeply nested payloads, and because only (JSONDecodeError, UnicodeDecodeError) are caught as JSONParseError, it falls through to -32603 (InternalError).

    PR #1568 looks clean and properly scoped around await request.json() (preserving -32603 for any downstream RecursionError in RequestHandler/AgentExecutor), with targeted test coverage.

    Assigning this issue to you until the PR is reviewed.

  4. added a commit that references this issue on Dec 2, 2026
    ada2166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: server

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions