{"record":{"id":"ca576ed292ad6048","repo":"n8n-io/n8n","slug":"assistant-sdk-response-has-no-body","errorCode":null,"errorMessage":"Assistant SDK response has no body","messagePattern":"Assistant SDK response has no body","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts","lineNumber":169,"sourceCode":"\t\t}\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Consume the SDK's streaming response, mapping messages and writing chunks.\n\t * Follows the same approach as the frontend streamRequest() utility.\n\t */\n\tprivate async consumeSdkStream(\n\t\tresponse: Response,\n\t\twriter: StreamWriter,\n\t\tsignal?: AbortSignal,\n\t\ttoolCallId?: string,\n\t\tcontext?: AssistantContext,\n\t): Promise<AssistantResult> {\n\t\tconst body = response.body;\n\t\tif (!body) {\n\t\t\tthrow new Error('Assistant SDK response has no body');\n\t\t}\n\n\t\tconst reader = (body as ReadableStream<Uint8Array>).getReader();\n\t\tconst decoder = new TextDecoder();\n\n\t\tlet buffer = '';\n\t\tconst state = {\n\t\t\tsdkSessionId: undefined as string | undefined,\n\t\t\tcollectedTexts: [] as string[],\n\t\t\thasCodeDiff: false,\n\t\t\tsuggestionIds: [] as string[],\n\t\t};\n\n\t\ttry {\n\t\t\twhile (true) {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tbreak;\n\t\t\t\t}","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts#L151-L187","documentation":"Error \"Assistant SDK response has no body\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}