{"record":{"id":"14bd73ada086afb5","repo":"n8n-io/n8n","slug":"the-assistant-was-interrupted-while-waiting-for-yo","errorCode":null,"errorMessage":"The assistant was interrupted while waiting for your response. Send a new message to continue.","messagePattern":"The assistant was interrupted while waiting for your response\\. Send a new message to continue\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/runtime/resumable-stream-executor.ts","lineNumber":637,"sourceCode":"\treturn {\n\t\t__correctionOverride: true,\n\t\tmessage:\n\t\t\t'The user sent a correction while this run was active. ' +\n\t\t\t'The confirmation has been skipped. Apply the correction and continue.',\n\t\tcorrections,\n\t};\n}\n\nfunction isErrorChunk(chunk: unknown): chunk is { type: 'error'; error?: unknown } {\n\treturn isRecord(chunk) && chunk.type === 'error';\n}\n\nasync function waitForConfirmation(\n\tsignal: AbortSignal,\n\tconfirmationPromise: Promise<Record<string, unknown>>,\n): Promise<Record<string, unknown>> {\n\tif (signal.aborted) {\n\t\tthrow new Error(\n\t\t\t'The assistant was interrupted while waiting for your response. Send a new message to continue.',\n\t\t);\n\t}\n\n\tlet abortHandler: (() => void) | undefined;\n\n\ttry {\n\t\treturn await Promise.race([\n\t\t\tconfirmationPromise,\n\t\t\tnew Promise<never>((_, reject) => {\n\t\t\t\tabortHandler = () =>\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t'The assistant was interrupted while waiting for your response. Send a new message to continue.',\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\tsignal.addEventListener('abort', abortHandler, { once: true });\n\t\t\t}),","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/runtime/resumable-stream-executor.ts#L619-L655","documentation":"Thrown by waitForConfirmation in resumable-stream-executor.ts when the AbortSignal fires (or is already aborted) while the assistant is suspended waiting for a HITL confirmation. The message is user-facing and instructs them to send a new message to resume. It fires both for a pre-aborted signal (line 636) and for an abort that arrives during the Promise.race (line 648-653).","triggerScenarios":"A user clicks stop/cancel (or the request is aborted by timeout/client disconnect) while a tool-call-suspended chunk is awaiting confirmation data. The AbortSignal trips and waitForConfirmation rejects before the confirmation promise resolves.","commonSituations":"User cancels a run mid-confirmation; client disconnects during a long HITL pause; a timeout aborts the request; a correction handler aborts the original run to start a new one.","solutions":["Send a new message in the same thread to resume the conversation; the suspension state is recoverable.","If aborts are unexpected, check the abort source (client timeout, proxy, or a correction flow that aborts the parent).","Increase the client/proxy timeout if the abort is purely a timeout during long user deliberation.","Verify no other code path is signaling the AbortController prematurely."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// No pre-call validation; the abort can arrive at any time.\n// Instead, ensure the AbortController is only aborted for genuine stop requests.","typeGuard":null,"tryCatchPattern":"try { await waitForConfirmation(signal, confirmationPromise); }\ncatch (e) {\n  if (e instanceof Error && e.message.includes('interrupted while waiting')) {\n    // keep the thread alive; user can send a new message to resume\n    return { status: 'interrupted' };\n  }\n  throw e;\n}","preventionTips":["Only abort for genuine stop requests; do not abort on transient timeouts if HITL is expected.","Lengthen client/proxy timeouts for runs that may pause for user confirmation.","Preserve suspended-run state so a new message can resume it.","Audit other code paths (correction handlers) that may abort the parent run prematurely."],"tags":["hitl","abort","streaming","user-facing","resumable"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}