{"record":{"id":"edb3f572024d3432","repo":"continuedev/continue","slug":"no-stream-received-from-bedrock-api-edb3f5","errorCode":null,"errorMessage":"No stream received from Bedrock API","messagePattern":"No stream received from Bedrock API","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":491,"sourceCode":"    };\n  }\n\n  async *chatCompletionStream(\n    body: ChatCompletionCreateParamsStreaming,\n    signal: AbortSignal,\n  ): AsyncGenerator<ChatCompletionChunk> {\n    const requestBody = this._convertBody(body);\n\n    try {\n      const command = new ConverseStreamCommand({\n        ...requestBody,\n      });\n\n      const client = await this.getClient();\n      const response = await client.send(command, { abortSignal: signal });\n\n      if (!response?.stream) {\n        throw new Error(\"No stream received from Bedrock API\");\n      }\n\n      for await (const chunk of response.stream) {\n        if (chunk.contentBlockDelta?.delta) {\n          const delta: any = chunk.contentBlockDelta.delta;\n\n          // Handle text content\n          if (delta.text) {\n            yield chatChunk({\n              content: delta.text,\n              model: body.model,\n            });\n            continue;\n          }\n\n          // Handle thinking content (if reasoning enabled)\n          if (delta.reasoningContent?.text) {\n            // TODO reasoning","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L473-L509","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function withBedrockStreamRetry(fn, retries = 2) {\n  for (let i = 0; ; i++) {\n    try { return await fn(); }\n    catch (e) {\n      if (e instanceof Error && e.message === 'No stream received from Bedrock API' && i < retries) {\n        await new Promise(r => setTimeout(r, 500 * 2 ** i));\n        continue;\n      }\n      throw e;\n    }\n  }\n}","preventionTips":["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"],"tags":["bedrock","aws","streaming","sdk","empty-response"],"backgroundTag":"empty-api-response","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}