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

  1. Retry the request — empty bodies are usually transient.
  2. Pin/upgrade @aws-sdk/client-bedrock-runtime to a stable version compatible with the adapter.
  3. Verify with the AWS CLI that the same modelId + payload returns a body (aws bedrock-runtime invoke-model).
  4. 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

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


AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27). Data as JSON: /api/errors/acdbf177ca5d0557. Report an issue: GitHub.