|
6 | 6 | type SessionModeState |
7 | 7 | } from "@agentclientprotocol/sdk"; |
8 | 8 | import {CodexEventHandler} from "./CodexEventHandler"; |
9 | | -import {CodexApprovalHandler} from "./CodexApprovalHandler"; |
10 | 9 | import {CodexAuthMethods, type CodexAuthRequest} from "./CodexAuthMethod"; |
11 | 10 | import {CodexAcpClient, type SessionMetadata, type SessionMetadataWithThread} from "./CodexAcpClient"; |
12 | 11 | import {ACPSessionConnection, type UpdateSessionEvent} from "./ACPSessionConnection"; |
@@ -35,7 +34,6 @@ import { |
35 | 34 | createFileChangeUpdate, |
36 | 35 | createMcpToolCallUpdate, |
37 | 36 | } from "./CodexToolCallMapper"; |
38 | | -import { createApprovalContextStore } from "./CodexApprovalContext"; |
39 | 37 |
|
40 | 38 | export interface SessionState { |
41 | 39 | sessionId: string, |
@@ -706,12 +704,12 @@ export class CodexAcpServer implements acp.Agent { |
706 | 704 | sessionState.lastTokenUsage = null; |
707 | 705 |
|
708 | 706 | try { |
709 | | - const approvalContext = createApprovalContextStore(); |
710 | | - const eventHandler = new CodexEventHandler(this.connection, sessionState, approvalContext); |
711 | | - const approvalHandler = new CodexApprovalHandler(this.connection, sessionState, approvalContext); |
712 | | - await this.codexAcpClient.subscribeToSessionEvents(params.sessionId, |
| 707 | + const eventHandler = new CodexEventHandler(this.connection, sessionState); |
| 708 | + this.codexAcpClient.subscribeToSessionEvents( |
| 709 | + params.sessionId, |
713 | 710 | (event) => eventHandler.handleNotification(event), |
714 | | - approvalHandler); |
| 711 | + eventHandler |
| 712 | + ); |
715 | 713 |
|
716 | 714 | if (await this.availableCommands.tryHandle(params.prompt, sessionState)) { |
717 | 715 | logger.log("Prompt handled by a command"); |
|
0 commit comments