From 2df9719e52c1a5042c013a85e921b13a2699e569 Mon Sep 17 00:00:00 2001 From: "mark.tkachenko" Date: Sun, 2 Aug 2026 17:12:51 +0200 Subject: [PATCH] fix: Stop emitting "Conversation interrupted" message --- src/CodexAcpServer.ts | 13 ------------- src/__tests__/CodexACPAgent/session-close.test.ts | 1 - 2 files changed, 14 deletions(-) diff --git a/src/CodexAcpServer.ts b/src/CodexAcpServer.ts index 0ed48705..f1fb9cec 100644 --- a/src/CodexAcpServer.ts +++ b/src/CodexAcpServer.ts @@ -1963,7 +1963,6 @@ export class CodexAcpServer { logger.log("Prompt handled by a command"); await this.codexAcpClient.waitForSessionNotifications(params.sessionId); if (commandResult.turnCompleted?.turn.status === "interrupted") { - await this.notifyConversationInterrupted(params.sessionId); return this.cancelledPromptResponse(sessionState); } const error = eventHandler.getFailure(); @@ -2044,7 +2043,6 @@ export class CodexAcpServer { if (turnCompleted.turn.status === "interrupted") { await eventHandler.flushPendingPlanUpdates(); - await this.notifyConversationInterrupted(params.sessionId); return this.cancelledPromptResponse(sessionState); } @@ -2121,7 +2119,6 @@ export class CodexAcpServer { await this.codexAcpClient.waitForSessionNotifications(params.sessionId); if (turnCompleted.turn.status === "interrupted") { await eventHandler.flushPendingPlanUpdates(); - await this.notifyConversationInterrupted(params.sessionId); return this.cancelledPromptResponse(sessionState); } @@ -2226,16 +2223,6 @@ export class CodexAcpServer { }; } - private async notifyConversationInterrupted(sessionId: string): Promise { - if (this.sessionIsClosing(sessionId) || !this.sessions.has(sessionId)) { - return; - } - await this.connection.notify(acp.methods.client.session.update, { - sessionId, - update: createAgentTextMessageChunk("*Conversation interrupted*"), - }); - } - private buildQuotaMeta(sessionState: SessionState): { quota: QuotaMeta } { const lastTokenUsage = sessionState.lastTokenUsage; diff --git a/src/__tests__/CodexACPAgent/session-close.test.ts b/src/__tests__/CodexACPAgent/session-close.test.ts index 5effd4b0..97fa73aa 100644 --- a/src/__tests__/CodexACPAgent/session-close.test.ts +++ b/src/__tests__/CodexACPAgent/session-close.test.ts @@ -86,7 +86,6 @@ describe("ACP session close", () => { const requestMethods = fixture.getCodexConnectionEvents([]) .flatMap(event => event.eventType === "request" ? [event.method] : []); expect(requestMethods).toEqual(["thread/unsubscribe"]); - expect(fixture.getAcpConnectionDump([])).not.toContain("Conversation interrupted"); expect(() => codexAcpAgent.getSessionState(sessionId)).toThrow(`Session ${sessionId} not found`); fixture.clearCodexConnectionDump();