Skip to content

Commit 68c5f5d

Browse files
committed
🤖 fix: delete partial in interruptStream when abandonPartial=true
Critical fix: interruptStream now deletes the partial when abandonPartial=true, mirroring the IPC handler pattern. Without this, the partial would be committed by streamWithHistory's unconditional commitToHistory call, reintroducing the cancelled assistant response into history. This completes the fix for editing compacting messages - now the cancelled output is truly discarded instead of being appended after truncation.
1 parent 753b35f commit 68c5f5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/node/services/agentSession.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,15 @@ export class AgentSession {
376376
return Err(stopResult.error);
377377
}
378378

379+
// Delete partial when abandoning to prevent commitToHistory from reintroducing it
380+
// Mirrors the IPC handler pattern (ipcMain.ts:1108-1110)
381+
if (abandonPartial) {
382+
const deleteResult = await this.partialService.deletePartial(this.workspaceId);
383+
if (!deleteResult.success) {
384+
return Err(deleteResult.error);
385+
}
386+
}
387+
379388
return Ok(undefined);
380389
}
381390

0 commit comments

Comments
 (0)