continuedev/continue · error · Error

No stream received from Bedrock API

Error message

No stream received from Bedrock API

What it means

Bedrock's Converse API returns a response object whose body is an async event stream; chatCompletionStream iterates response.stream to yield chunks. If the SDK response is unexpectedly missing or has no stream property (empty response, SDK/transport anomaly, throttled invocation returning an unusable body), the adapter throws this guard error instead of undefined-destructuring crashes.

Source

Thrown at packages/openai-adapters/src/apis/Bedrock.ts:491

    };
  }

  async *chatCompletionStream(
    body: ChatCompletionCreateParamsStreaming,
    signal: AbortSignal,
  ): AsyncGenerator<ChatCompletionChunk> {
    const requestBody = this._convertBody(body);

    try {
      const command = new ConverseStreamCommand({
        ...requestBody,
      });

      const client = await this.getClient();
      const response = await client.send(command, { abortSignal: signal });

      if (!response?.stream) {
        throw new Error("No stream received from Bedrock API");
      }

      for await (const chunk of response.stream) {
        if (chunk.contentBlockDelta?.delta) {
          const delta: any = chunk.contentBlockDelta.delta;

          // Handle text content
          if (delta.text) {
            yield chatChunk({
              content: delta.text,
              model: body.model,
            });
            continue;
          }

          // Handle thinking content (if reasoning enabled)
          if (delta.reasoningContent?.text) {
            // TODO reasoning

View on GitHub (pinned to 5522c6f44c)

Solutions

  1. Retry the request once — transient AWS/SDK hiccups often resolve immediately
  2. Pin/align the @aws-sdk/client-bedrock-runtime version with the one the adapter was built against
  3. If using a Bedrock-compatible proxy or custom endpoint, verify it returns a proper ConverseStream event-stream body
  4. Enable AWS SDK logging to inspect the raw response when it recurs
Defensive patterns

Strategy: retry

Try / catch

async function withBedrockStreamRetry(fn, retries = 2) {
  for (let i = 0; ; i++) {
    try { return await fn(); }
    catch (e) {
      if (e instanceof Error && e.message === 'No stream received from Bedrock API' && i < retries) {
        await new Promise(r => setTimeout(r, 500 * 2 ** i));
        continue;
      }
      throw e;
    }
  }
}

Prevention

When it happens

Trigger: client.send(command) resolves but response or response.stream is null/undefined — e.g. an edge-region response with an empty body, an SDK version mismatch, or an invoke-with-response-stream that returned no events container. Note the error surfaces from chatCompletionNonStream's internal path via chatCompletionStream.

Common situations: Upgrading @aws-sdk/client-bedrock-runtime across major versions where the response shape changed; intermittent AWS-side anomalies or throttling; misconfigured custom Bedrock-compatible endpoints (e.g. gateways/proxies) that return a well-formed status but empty payload.

Related errors


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