continuedev/continue · error · Error
No response body
Error message
No response body
What it means
getInvokeModelResponseBody sends an InvokeModelCommand and expects a binary body back; if the AWS SDK response has an empty/absent body (falsy response.body), the adapter throws 'No response body' before attempting to decode. This typically indicates the service returned an empty payload or the SDK/stream handling already consumed it.
Source
Thrown at packages/openai-adapters/src/apis/Bedrock.ts:603
fimStream(
body: FimCreateParamsStreaming,
): AsyncGenerator<ChatCompletionChunk> {
throw new Error("Bedrock does not support FIM directly");
}
private async getInvokeModelResponseBody(model: string, jsonBody: object) {
const payload = {
body: JSON.stringify(jsonBody),
modelId: model,
accept: "*/*",
contentType: "application/json",
};
const command = new InvokeModelCommand(payload);
const client = await this.getClient();
const response = await client.send(command);
if (!response.body) {
throw new Error("No response body");
}
const decoder = new TextDecoder();
const decoded = decoder.decode(response.body);
return JSON.parse(decoded);
}
private getEmbedTexts(body: EmbeddingCreateParams): string[] {
const texts: string[] = [];
if (typeof body.input === "string") {
texts.push(body.input);
} else if (body.input.length > 0) {
const firstVal = body.input[0];
if (Array.isArray(firstVal)) {
throw new Error("Unsupported embeddings type received: number[][]");
}
if (typeof firstVal === "string") {
texts.push(...(body.input as string[]));
} else {View on GitHub (pinned to 5522c6f44c)
Solutions
- Retry the request — empty bodies are usually transient.
- Pin/upgrade @aws-sdk/client-bedrock-runtime to a stable version compatible with the adapter.
- Verify with the AWS CLI that the same modelId + payload returns a body (aws bedrock-runtime invoke-model).
- Check adapter issue tracker for known SDK version incompatibilities.
Example fix
// before
const out = await api.getInvokeModelResponseBody(model, body);
// after
let out;
for (let i = 0; i < 3; i++) {
try { out = await api.getInvokeModelResponseBody(model, body); break; }
catch (e) { if (e.message !== 'No response body' || i === 2) throw e; await new Promise(r => setTimeout(r, 2 ** i * 500)); }
} Defensive patterns
Strategy: retry
Try / catch
let lastErr;
for (let i = 0; i < 3; i++) {
try { return await api.embed(body); }
catch (e) {
lastErr = e;
if (e instanceof Error && e.message === 'No response body' && i < 2) { await new Promise(r => setTimeout(r, 2 ** i * 500)); continue; }
throw e;
}
}
throw lastErr; Prevention
- Retry transient empty-body responses with backoff.
- Pin a known-good @aws-sdk/client-bedrock-runtime version.
- Probe models with a small request before batch jobs to detect the issue early.
When it happens
Trigger: Calling embed, output, or responseBody paths that route through getInvokeModelResponseBody and the InvokeModel response arrives with an empty body; intermittent Bedrock service-side empty responses; SDK middleware transforming the response incorrectly.
Common situations: Transient Bedrock hiccups returning 200 with empty payload; mismatched AWS SDK v3 versions where response body handling changed; invoking an incompatible model that returns no JSON payload.
Related errors
- No stream received from Bedrock API
- AWS Bedrock rerank error (${(error as any).code}): ${error.m
- Error in BedrockReranker.rerank: ${error.message}
- Error in BedrockReranker.rerank: Unknown error occurred
- Malformed JSON received from Bedrock: ${decoded}
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/acdbf177ca5d0557.
Report an issue: GitHub.