Skip to content

Commit dde0c5f

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 dde0c5f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/node/services/ipcMain.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,18 +1098,13 @@ export class IpcMain {
10981098
log.debug("interruptStream handler: Received", { workspaceId, options });
10991099
try {
11001100
const session = this.getOrCreateSession(workspaceId);
1101+
// interruptStream now handles partial deletion internally when abandonPartial=true
11011102
const stopResult = await session.interruptStream(options?.abandonPartial);
11021103
if (!stopResult.success) {
11031104
log.error("Failed to stop stream:", stopResult.error);
11041105
return { success: false, error: stopResult.error };
11051106
}
11061107

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-
11131108
return { success: true, data: undefined };
11141109
} catch (error) {
11151110
const errorMessage = error instanceof Error ? error.message : String(error);

0 commit comments

Comments
 (0)