From 9e9f315b144dc12e95a5ab67e5dd6becbd698e4f Mon Sep 17 00:00:00 2001 From: Vellum Assistant Date: Wed, 25 Feb 2026 14:06:46 -0500 Subject: [PATCH 1/2] fix: delete orphaned conversation when recording start is rejected Co-Authored-By: Claude --- assistant/src/daemon/handlers/misc.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assistant/src/daemon/handlers/misc.ts b/assistant/src/daemon/handlers/misc.ts index 61da49f02ba..abb86dd3c88 100644 --- a/assistant/src/daemon/handlers/misc.ts +++ b/assistant/src/daemon/handlers/misc.ts @@ -110,10 +110,18 @@ export async function handleTaskSubmit( ctx.send(socket, { type: 'task_routed', sessionId: conversation.id, interactionType: 'text_qa' }); ctx.send(socket, { type: 'assistant_text_delta', text: 'Starting screen recording.', sessionId: conversation.id }); } else { + // Recording was rejected (already active) — clean up the orphaned conversation ctx.send(socket, { type: 'task_routed', sessionId: conversation.id, interactionType: 'text_qa' }); ctx.send(socket, { type: 'assistant_text_delta', text: 'A recording is already active.', sessionId: conversation.id }); } ctx.send(socket, { type: 'message_complete', sessionId: conversation.id }); + + if (!recordingId) { + // Delete the conversation since no recording was started — prevents empty orphans + conversationStore.deleteConversation(conversation.id); + ctx.socketToSession.delete(socket); + } + rlog.info({ sessionId: conversation.id }, 'Recording-only intent intercepted — routed to standalone recording'); return; } From 31586eb1b7f7a405fd71d3f94373af40bbb18f02 Mon Sep 17 00:00:00 2001 From: Vellum Assistant Date: Wed, 25 Feb 2026 14:11:41 -0500 Subject: [PATCH 2/2] fix: keep conversation on rejection, only unbind socket to avoid FK violations Co-Authored-By: Claude Opus 4.6 --- assistant/src/daemon/handlers/misc.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assistant/src/daemon/handlers/misc.ts b/assistant/src/daemon/handlers/misc.ts index abb86dd3c88..09998d8f901 100644 --- a/assistant/src/daemon/handlers/misc.ts +++ b/assistant/src/daemon/handlers/misc.ts @@ -117,8 +117,9 @@ export async function handleTaskSubmit( ctx.send(socket, { type: 'message_complete', sessionId: conversation.id }); if (!recordingId) { - // Delete the conversation since no recording was started — prevents empty orphans - conversationStore.deleteConversation(conversation.id); + // Unbind the socket so the ephemeral rejection session doesn't block + // future task_submit routing, but keep the conversation in the DB so + // the client can still send follow-up messages to the routed sessionId. ctx.socketToSession.delete(socket); }