n8n-io/n8n · error · Error

Assistant SDK response has no body

Error message

Assistant SDK response has no body

What it means

Structural error in assistant-handler's consumeSdkStream. It fires when the validated (ok) SDK Response has a null body, so there is no stream to read. Unusual for a 2xx response; the guard prevents a null-dereference in getReader and converts it into a clear error.

Solutions

  1. Re-try the request; a response with no body is anomalous and usually indicates an upstream/gateway fault.
  2. Check the SDK client and proxy configuration for response-body stripping.
  3. If persistent, inspect the gateway logs for the session to see why the stream was dropped.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts:169 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/ca576ed292ad6048. Report an issue: GitHub.

Appendix: source

Thrown at packages/@n8n/ai-workflow-builder.ee/src/assistant/assistant-handler.ts:169

		}

		return response;
	}

	/**
	 * Consume the SDK's streaming response, mapping messages and writing chunks.
	 * Follows the same approach as the frontend streamRequest() utility.
	 */
	private async consumeSdkStream(
		response: Response,
		writer: StreamWriter,
		signal?: AbortSignal,
		toolCallId?: string,
		context?: AssistantContext,
	): Promise<AssistantResult> {
		const body = response.body;
		if (!body) {
			throw new Error('Assistant SDK response has no body');
		}

		const reader = (body as ReadableStream<Uint8Array>).getReader();
		const decoder = new TextDecoder();

		let buffer = '';
		const state = {
			sdkSessionId: undefined as string | undefined,
			collectedTexts: [] as string[],
			hasCodeDiff: false,
			suggestionIds: [] as string[],
		};

		try {
			while (true) {
				if (signal?.aborted) {
					break;
				}

View on GitHub (pinned to 5ac6606e81)