fix: reject numeric request ids that are not safe integers #290
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 183 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.312
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #290"
general
weight: 0.35
rozzilla
Problem
JSON-RPC ids go through
JSON.parse, so a numeric id aboveNumber.MAX_SAFE_INTEGERloses precision.{"jsonrpc":"2.0","id":9007199254740993,"method":"tools/list"}got a 200 response with"id":9007199254740992. basic.md says responses MUST include the same ID as the request, and requests MUST include a string or integer ID.Fix
checkRequestId()insrc/handlers.ts: a message whoseidis a number that failsNumber.isSafeIntegergets-32600 Invalid Requestwithid: null.POST /mcpreturns that error with HTTP 400 before doing any session work.inject. Without that, an id like1e400would parse toInfinityandJSON.stringifywould send it on asnull.String ids of any length still work, and so does
±Number.MAX_SAFE_INTEGER.Breaking change
Requests with fractional numeric ids (e.g.
1.5) used to be accepted and are now rejected with -32600 / HTTP 400. The spec requires a string or integer id, so this brings the server in line with it.Tests
id: null; a fractional id is rejected;±MAX_SAFE_INTEGERand a large string id are echoed back unchanged.1e400both get -32600 withid: null.Fixes #271
🤖 Generated with Claude Code
https://claude.ai/code/session_01UF4S3w7iA83V9DVsasLJzM