Skip to content

Commit 73d8397

Browse files
committed
🤖 refactor: remove duplicate partial deletion from IPC handler
interruptStream() now owns the complete interrupt flow including partial deletion. The IPC handler is now a thin wrapper that delegates fully. This eliminates duplication - previously both layers were deleting the partial when abandonPartial=true, making two calls to deletePartial() for IPC-triggered interrupts (though the second was idempotent). Single source of truth: AgentSession.interruptStream() handles everything.
1 parent 68c5f5d commit 73d8397

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/node/services/agentSession.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ export class AgentSession {
377377
}
378378

379379
// Delete partial when abandoning to prevent commitToHistory from reintroducing it
380-
// Mirrors the IPC handler pattern (ipcMain.ts:1108-1110)
381380
if (abandonPartial) {
382381
const deleteResult = await this.partialService.deletePartial(this.workspaceId);
383382
if (!deleteResult.success) {

src/node/services/ipcMain.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,12 +1104,6 @@ export class IpcMain {
11041104
return { success: false, error: stopResult.error };
11051105
}
11061106

1107-
// If abandonPartial is true, delete the partial instead of committing it
1108-
if (options?.abandonPartial) {
1109-
log.debug("Abandoning partial for workspace:", workspaceId);
1110-
await this.partialService.deletePartial(workspaceId);
1111-
}
1112-
11131107
return { success: true, data: undefined };
11141108
} catch (error) {
11151109
const errorMessage = error instanceof Error ? error.message : String(error);

0 commit comments

Comments
 (0)