From 08b411fc3bc0d266bdadfe1c6ddf72f2ebf11f7c Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 12 Mar 2026 01:24:42 +0900 Subject: [PATCH] fix: use rest params in LSP sendNotification to avoid undefined serialization (#2185) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/tools/lsp/lsp-client-transport.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/tools/lsp/lsp-client-transport.ts b/src/tools/lsp/lsp-client-transport.ts index d4590262b..1b6b85c5d 100644 --- a/src/tools/lsp/lsp-client-transport.ts +++ b/src/tools/lsp/lsp-client-transport.ts @@ -114,7 +114,9 @@ export class LSPClientTransport { read() } - protected async sendRequest(method: string, params?: unknown): Promise { + protected sendRequest(method: string): Promise + protected sendRequest(method: string, params: unknown): Promise + protected async sendRequest(method: string, ...args: [] | [unknown]): Promise { if (!this.connection) throw new Error("LSP client not started") if (this.processExited || (this.proc && this.proc.exitCode !== null)) { @@ -130,7 +132,7 @@ export class LSPClientTransport { }, this.REQUEST_TIMEOUT) }) - const requestPromise = this.connection.sendRequest(method, params) as Promise + const requestPromise = this.connection.sendRequest(method, ...args) as Promise try { const result = await Promise.race([requestPromise, timeoutPromise]) @@ -142,10 +144,12 @@ export class LSPClientTransport { } } - protected sendNotification(method: string, params?: unknown): void { + protected sendNotification(method: string): void + protected sendNotification(method: string, params: unknown): void + protected sendNotification(method: string, ...args: [] | [unknown]): void { if (!this.connection) return if (this.processExited || (this.proc && this.proc.exitCode !== null)) return - this.connection.sendNotification(method, params) + this.connection.sendNotification(method, ...args) } isAlive(): boolean {