feat(server-utils): Port Bedrock aws-sdk extension and add integration tests#22166
feat(server-utils): Port Bedrock aws-sdk extension and add integration tests#22166andreiborza wants to merge 3 commits into
Conversation
| } | ||
|
|
||
| if (request.commandInput?.body) { | ||
| const requestBody = JSON.parse(request.commandInput.body); |
There was a problem hiding this comment.
InvokeModel body not decoded
Medium Severity
_requestPreSpanHookInvokeModel passes commandInput.body directly to JSON.parse. The AWS SDK often supplies body as a Uint8Array (or Buffer), not a string; unlike the response path, the request path does not decode binary first, so parsing fails or request gen_ai attributes are missing.
Reviewed by Cursor Bugbot for commit cccdbe5. Configure here.
bdc838e to
9297436
Compare
188ac82 to
ff165d4
Compare
9297436 to
31816fd
Compare
ff165d4 to
a4dd353
Compare
31816fd to
0b89e37
Compare
size-limit report 📦
|
a4dd353 to
968db2f
Compare
0b89e37 to
a3978fa
Compare
968db2f to
5f2a15f
Compare
809da29 to
8907ff9
Compare
5f2a15f to
8f3599b
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8f3599b. Configure here.
8907ff9 to
c0e10d6
Compare
8f3599b to
0a944ab
Compare
c0e10d6 to
561e41b
Compare
0a944ab to
5506257
Compare
561e41b to
8ffb46b
Compare
5506257 to
14699e8
Compare
…n tests Ports the BedrockRuntime gen_ai service extension from the OTel aws-sdk integration to the orchestrion channel integration: chat span name and request parameters for `Converse`/`ConverseStream`, per-model-family request body parsing for `InvokeModel`/`InvokeModelWithResponseStream` (titan, nova, claude, llama, cohere, mistral), token usage and finish reasons from responses, and deferred span end for the streaming commands (the span ends when the wrapped stream is consumed). Adds nock-mocked integration tests for the non-streaming `Converse` and `InvokeModel` commands, asserted against both the OTel and diagnostics-channel paths. The streaming commands use the AWS binary eventstream framing which nock cannot mock, so they stay untested here. This completes orchestrion parity with the OTel aws-sdk integration. Fixes #20946 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
14699e8 to
a464258
Compare
8ffb46b to
556da6f
Compare


Ports the BedrockRuntime gen_ai service extension from the OTel aws-sdk integration to the orchestrion channel integration: chat span name and request parameters for
Converse/ConverseStream, per-model-family request body parsing forInvokeModel/InvokeModelWithResponseStream(titan, nova, claude, llama, cohere, mistral), token usage and finish reasons from responses, and deferred span end for the streaming commands (the span ends when the wrapped stream is consumed).Adds nock-mocked integration tests for the non-streaming
ConverseandInvokeModelcommands, asserted against both the OTel and diagnostics-channel paths. The streaming commands use the AWS binary eventstream framing which nock cannot mock, so they stay untested here.This completes orchestrion parity with the OTel aws-sdk integration.
User-facing differences to the vendored OTel instrumentation
ConverseStreamcallers receive the original response object with itsstreamwrapped in place, instead of a new object (a channel subscriber can't replace the resolved value); relevant only to identity-sensitive codeFixes #20946