You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Modern MCP engine: unserializable arguments read "effect unknown", and a failed HTTP request is also reported as a server error #556
Two small accounting gaps in the modern engine (src/mcpl/modern-connection.ts, main b82ba630). Both predate #540.
1. Unserializable arguments
ObservedTransport.send (~180-205) marks a request handedOff before calling the inner transport, and undoes the mark only for NotWrittenError. A TypeError from JSON.stringify (a BigInt, a cyclic object) is thrown before any byte goes out, but the mark stays. The outcome is then no-response with "whether it took effect is unknown", even though nothing was sent.
Reproduced on Node 22.21 with callTool('op', { n: 1n }): no tools/call on the wire.
Only in-process module code can pass such values.
Fix: serialize before setting handedOff, or have the transports throw NotWrittenError on a serialization failure.
2. HTTP failures counted twice
The SDK's HTTP send calls onerror and then rethrows. ObservedTransport forwards onerror to client.onerror, which emits the connection 'error', which the framework traces as mcpl:server-error. So every failed HTTP request appears both as the request's rejection and as an out-of-band server error. That double-counts in traces and alerts built on mcpl:server-error.
Found by reading against SDK 2.3.1; not run.
Fix: suppress onerror for an error the same send rethrows.
How found: review of #540, flagged by the second reviewer.
Activity
fix(mcp): a request JSON can't write reads not-sent, an HTTP failure …