Fix: Preserve MCP Notification Handler Binding

This change addresses the regression introduced by commit 38e8fe8d02, which broke the codex switch.
This commit is contained in:
weishu
2025-12-26 17:05:03 +08:00
parent 702072e9ba
commit d26a7c8996
+5 -4
View File
@@ -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;