From d26a7c8996d1f9aede356e6b378612942975ced5 Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 26 Dec 2025 17:03:31 +0800 Subject: [PATCH] Fix: Preserve MCP Notification Handler Binding This change addresses the regression introduced by commit 38e8fe8d02b456092760e62dc4647eb4d4648677, which broke the codex switch. --- cli/src/codex/codexMcpClient.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/src/codex/codexMcpClient.ts b/cli/src/codex/codexMcpClient.ts index 522e66f2..47b8f905 100644 --- a/cli/src/codex/codexMcpClient.ts +++ b/cli/src/codex/codexMcpClient.ts @@ -187,10 +187,11 @@ export class CodexMcpClient { }) }).passthrough(); - const setNotificationHandler = this.client.setNotificationHandler as ( - schema: unknown, - handler: (notification: { params: { msg: any } }) => void - ) => void; + const setNotificationHandler = + this.client.setNotificationHandler.bind(this.client) as ( + schema: unknown, + handler: (notification: { params: { msg: any } }) => void + ) => void; setNotificationHandler(codexNotificationSchema, (data) => { const msg = data.params.msg;