Skip to content

Request ids above 2^53 are answered with a different id #271

Closed

Description

@mcollina

JSON-RPC ids are parsed with JSON.parse, so a numeric id above Number.MAX_SAFE_INTEGER loses precision and the response carries a different id. basic.md: "Result responses MUST include the same ID as the request they correspond to."

Repro

{"jsonrpc":"2.0","id":9007199254740993,"method":"tools/list"} → response "id":9007199254740992, status 200.

Suggested fix

Refuse numeric ids that are not safe integers with -32600 (simplest), or keep the raw id text.

Found during the round-7 review of #170; also on main.

🤖 Generated with Claude Code

Activity

  1. added a commit that references this issue on Oct 14, 2026
    fb6c992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions