From 167b9b4dab49092f928cc42718a8a21e5fe5e930 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Sun, 23 Aug 2026 17:54:26 -0400 Subject: [PATCH] fix: validate every reserved `_meta` member against the SDK's own schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `progressToken` was not the only reserved key. The pinned SDK's `RequestMetaSchema` also constrains `io.modelcontextprotocol/related-task` to `{ taskId: string }`, and a conforming server rejects the *whole request* over one bad reserved member rather than ignoring that key. Before #1910 every value was a string, so only `progressToken` could be wrong; the widening made all of them reachable. Replace both hand-rolled checks with the SDK's schemas — `RequestMetaSchema` for the payload, `ProgressTokenSchema` for the single value. The schema is loose, so unknown keys pass through untouched, and zod reports the offending top-level key as `issue.path[0]`, so only that member is dropped and its siblings survive. A member the SDK constrains in a later release is then covered without anyone remembering to add it — which is the drift that produced the `isInteger`/`isSafeInteger` bug one round ago. `name` was hard-coded, and react-ace uses it as the editor container's DOM id, so two instances emitted duplicate ids. Derived from the per-instance id, and deliberately distinct from the id given to the textarea — that one is what the wrapper's `