@@ -6,7 +6,7 @@ import {CodexElicitationHandler} from "./CodexElicitationHandler";
66import { type CodexAuthRequest , getCodexAuthMethods } from "./CodexAuthMethod" ;
77import { CodexAcpClient , type SessionMetadata , type SessionMetadataWithThread } from "./CodexAcpClient" ;
88import type { McpStartupResult } from "./CodexAppServerClient" ;
9- import { ACPSessionConnection , type UpdateSessionEvent } from "./ACPSessionConnection" ;
9+ import { ACPSessionConnection , type AcpClientConnection , type UpdateSessionEvent } from "./ACPSessionConnection" ;
1010import type { InputModality , ReasoningEffort } from "./app-server" ;
1111import type {
1212 Account ,
@@ -102,15 +102,15 @@ interface ActivePrompt {
102102 complete : ( ) => void ;
103103}
104104
105- export class CodexAcpServer implements acp . Agent {
105+ export class CodexAcpServer {
106106 private static readonly MODEL_NAME_TOKEN_OVERRIDES : Record < string , string > = {
107107 gpt : "GPT" ,
108108 mini : "Mini" ,
109109 codex : "Codex" ,
110110 } ;
111111
112112 private readonly codexAcpClient : CodexAcpClient ;
113- private readonly connection : acp . AgentSideConnection ;
113+ private readonly connection : AcpClientConnection ;
114114 private readonly defaultAuthRequest : CodexAuthRequest | null ;
115115 private readonly getExitCode : ( ) => number | null ;
116116 private readonly getRecentStderr : ( ) => string ;
@@ -127,7 +127,7 @@ export class CodexAcpServer implements acp.Agent {
127127 private readonly sessionOpenGenerations : Map < string , number > ;
128128
129129 constructor (
130- connection : acp . AgentSideConnection ,
130+ connection : AcpClientConnection ,
131131 codexAcpClient : CodexAcpClient ,
132132 defaultAuthRequest ?: CodexAuthRequest ,
133133 getExitCode ?: ( ) => number | null ,
@@ -1110,7 +1110,7 @@ export class CodexAcpServer implements acp.Agent {
11101110 : mcpStartup ;
11111111
11121112 for ( const update of CodexEventHandler . createMcpStartupUpdates ( filteredStartup ) ) {
1113- await this . connection . sessionUpdate ( {
1113+ await this . connection . notify ( acp . methods . client . session . update , {
11141114 sessionId,
11151115 update,
11161116 } ) ;
@@ -1281,7 +1281,7 @@ export class CodexAcpServer implements acp.Agent {
12811281 await this . codexAcpClient . waitForSessionNotifications ( params . sessionId ) ;
12821282 if ( commandResult . turnCompleted ?. turn . status === "interrupted" ) {
12831283 if ( ! this . sessionIsClosing ( params . sessionId ) && this . sessions . has ( params . sessionId ) ) {
1284- await this . connection . sessionUpdate ( {
1284+ await this . connection . notify ( acp . methods . client . session . update , {
12851285 sessionId : params . sessionId ,
12861286 update : {
12871287 sessionUpdate : "agent_message_chunk" ,
@@ -1382,7 +1382,7 @@ export class CodexAcpServer implements acp.Agent {
13821382 // Check if turn was interrupted (cancelled)
13831383 if ( turnCompleted . turn . status === "interrupted" ) {
13841384 if ( ! this . sessionIsClosing ( params . sessionId ) && this . sessions . has ( params . sessionId ) ) {
1385- await this . connection . sessionUpdate ( {
1385+ await this . connection . notify ( acp . methods . client . session . update , {
13861386 sessionId : params . sessionId ,
13871387 update : {
13881388 sessionUpdate : "agent_message_chunk" ,
0 commit comments