From 49777d565265424726af6b653adc99b592dbfd9b Mon Sep 17 00:00:00 2001 From: PapacyDai Date: Thu, 29 May 2025 15:15:52 +0800 Subject: [PATCH] fix: Ensure _meta object is not lost when onprogress option is passed When the onprogress option is passed, the _meta object in the request params was being overwritten, causing any existing _meta content to be lost. --- src/shared/protocol.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/protocol.ts b/src/shared/protocol.ts index 4694929d..98f8e1c9 100644 --- a/src/shared/protocol.ts +++ b/src/shared/protocol.ts @@ -541,7 +541,10 @@ export abstract class Protocol< this._progressHandlers.set(messageId, options.onprogress); jsonrpcRequest.params = { ...request.params, - _meta: { progressToken: messageId }, + _meta: { + ...(request.params._meta || {}), + progressToken: messageId + }, }; }