@@ -30,7 +30,6 @@ export class CodexEventHandler {
3030 private readonly connection : acp . AgentSideConnection ;
3131 private readonly sessionState : SessionState ;
3232 private failure : RequestError | null = null ;
33- private readonly terminalOutputs : Map < string , string > = new Map ( ) ;
3433
3534 constructor ( connection : acp . AgentSideConnection , sessionState : SessionState ) {
3635 this . connection = connection ;
@@ -73,7 +72,6 @@ export class CodexEventHandler {
7372 return null ;
7473 case "turn/completed" :
7574 this . sessionState . currentTurnId = null ;
76- this . terminalOutputs . clear ( ) ;
7775 return null ;
7876 case "thread/tokenUsage/updated" :
7977 this . handleTokenUsageUpdated ( notification . params ) ;
@@ -197,25 +195,19 @@ export class CodexEventHandler {
197195 }
198196
199197 private createCommandOutputDeltaEvent ( event : CommandExecutionOutputDeltaNotification ) : UpdateSessionEvent {
200- const accumulated = ( this . terminalOutputs . get ( event . itemId ) ?? "" ) + event . delta ;
201- this . terminalOutputs . set ( event . itemId , accumulated ) ;
202-
203198 return {
204199 sessionUpdate : "tool_call_update" ,
205200 toolCallId : event . itemId ,
206201 _meta : {
207- terminal_output : {
208- data : accumulated ,
202+ terminal_output_delta : {
203+ data : event . delta ,
209204 terminal_id : event . itemId
210205 }
211206 }
212207 }
213208 }
214209
215210 private completeCommandExecutionEvent ( item : ThreadItem & { "type" : "commandExecution" } ) : UpdateSessionEvent {
216- // Clean up accumulator
217- this . terminalOutputs . delete ( item . id ) ;
218-
219211 return {
220212 sessionUpdate : "tool_call_update" ,
221213 toolCallId : item . id ,
0 commit comments