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;