Ensure JSONRPCError messages are sent for streamable http

Prior to this, any JSONRPCError message sent when `enableJsonResponse` is true would be ignored (and response.end() never called)
This commit is contained in:
Michael Hart 2025-04-25 22:18:18 +10:00 • committed by GitHub
commit 67ad0bd773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -587,7 +587,7 @@ export class StreamableHTTPServerTransport implements Transport {
}
}
if (isJSONRPCResponse(message)) {
if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
this._requestResponseMap.set(requestId, message);
const relatedIds = Array.from(this._requestToStreamMapping.entries())
.filter(([_, streamId]) => this._streamMapping.get(streamId) === response)