Fix JSON-RPC request ID type to match specification#416
Merged
alexhancock merged 1 commit intomainfrom Sep 4, 2025
Merged
Conversation
Contributor
|
It looks like you are working on an outdated version, which hasn't been updated since half years ago? |
Member
Author
|
Whoops. Somehow completely botched that. I'll update the PR. The problem is still valid that, since |
0ff03de to
ab79c05
Compare
The JSON-RPC 2.0 specification allows the ID field to be any JSON number, including negative integers and large values. The previous u32 implementation was limited to 0-4,294,967,295 and couldn't handle negative IDs. Changes: - Changed NumberOrString::Number from u32 to i64 to support full JSON number range - Updated deserializer to handle both signed and unsigned integers - Modified AtomicU32Provider to use AtomicU64 internally with i64 conversion - Fixed progress token handling in meta.rs for i64 values - Added comprehensive test for negative and large request IDs This ensures full compliance with the JSON-RPC 2.0 specification. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
5584862 to
57f9063
Compare
alexhancock
approved these changes
Sep 4, 2025
Merged
takumi-earth
pushed a commit
to earthlings-dev/rmcp
that referenced
this pull request
Jan 27, 2026
…tocol#416) The JSON-RPC 2.0 specification allows the ID field to be any JSON number, including negative integers and large values. The previous u32 implementation was limited to 0-4,294,967,295 and couldn't handle negative IDs. Changes: - Changed NumberOrString::Number from u32 to i64 to support full JSON number range - Updated deserializer to handle both signed and unsigned integers - Modified AtomicU32Provider to use AtomicU64 internally with i64 conversion - Fixed progress token handling in meta.rs for i64 values - Added comprehensive test for negative and large request IDs This ensures full compliance with the JSON-RPC 2.0 specification. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
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.
Fixes the issue that the Json RPC request id is u32. However the JSON RPC spec mentions that this is supposed to be a number, meaning it can be negative and is typically 64bit. So we need to use an i64 here.