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 reasoningView on GitHub (pinned to 5522c6f44c)
Solutions
- Retry the request once — transient AWS/SDK hiccups often resolve immediately
- Pin/align the @aws-sdk/client-bedrock-runtime version with the one the adapter was built against
- If using a Bedrock-compatible proxy or custom endpoint, verify it returns a proper ConverseStream event-stream body
- 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
- Pin a known-good @aws-sdk/client-bedrock-runtime version in package.json
- Wrap streaming calls in a bounded retry with exponential backoff
- Enable AWS SDK logging to capture the raw response when this fires; check proxies/gateways if using a custom endpoint
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
- Error in BedrockReranker.rerank: ${error.message}
- Malformed JSON received from Bedrock: ${decoded}
- AWS Bedrock stream error (${(error as any).code}): ${error.m
- AWS Bedrock rerank error (${(error as any).code}): ${error.m
- Error in BedrockReranker.rerank: Unknown error occurred
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/edb3f572024d3432.
Report an issue: GitHub.