Skip to content

ref(aws-serverless): Vendor aws-sdk instrumentation#20978

Closed
nicohrubec wants to merge 5 commits into
developfrom
nh/vendor-aws-sdk-instrumentation
Closed

ref(aws-serverless): Vendor aws-sdk instrumentation#20978
nicohrubec wants to merge 5 commits into
developfrom
nh/vendor-aws-sdk-instrumentation

Conversation

@nicohrubec
Copy link
Copy Markdown
Member

@nicohrubec nicohrubec commented May 18, 2026

Vendors @opentelemetry/instrumentation-aws-sdk into the SDK with no logic changes. TokenUsage and ConverseStreamOutput types from @aws-sdk/client-bedrock-runtime are inlined as simplified interfaces to avoid requiring the package as a dependency.

Closes #20514

nicohrubec and others added 3 commits May 18, 2026 15:02
Closes #20514

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b1be2ff. Configure here.


if (request.commandInput?.body) {
const requestBody = JSON.parse(request.commandInput.body);
if (modelId.includes('amazon.titan')) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined modelId crashes on .includes() call

Medium Severity

In requestPreSpanHookInvokeModel, modelId is obtained via optional chaining (request.commandInput?.modelId) and can be undefined. The code enters the if (request.commandInput?.body) block without re-checking modelId, then calls modelId.includes('amazon.titan') which throws a TypeError if modelId is undefined. The same pattern exists in responseHookInvokeModel where currentModelId is used without a null guard before calling .includes().

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b1be2ff. Configure here.

@nicohrubec nicohrubec closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant