Fix Bedrock user agent to report full SDK details #7273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Related Issue
Issue: #9031
Description
This PR fixes an incomplete user agent string issue in AWS Bedrock CloudTrail logs. Currently, when using Bedrock, CloudTrail only shows
cline/3.35.1 m/E,e, missing critical context like OS version, SDK version, and runtime details.Root Cause: A previous fix (PR #6821 ) used
defaultUserAgentProviderwhich replaced the entire user agent string instead of appending to it. At that time, the AWS SDK didn't properly support thecustomUserAgentfield, but this has since been resolved in aws/aws-sdk-js-v3#7445.Solution: This PR:
defaultUserAgentProvidertocustomUserAgentin bedrock.ts to append rather than replace the user agentExpected Result: CloudTrail logs will now show complete details:
Test Procedure
Testing approach:
defaultUserAgentProvidertocustomUserAgentwith the new SDK version will properly append rather than replaceWhat could break:
Verification plan:
Confidence: The change follows AWS SDK best practices and uses the officially recommended
customUserAgentfield. The SDK upgrade is a minor version bump with no breaking changes noted in the changelog.Type of Change
Pre-flight Checklist
npm test) and code is formatted and linted (npm run format && npm run lint)npm run changeset(required for user-facing changes)Screenshots
Additional Notes
This fix is important for all Bedrock users who rely on CloudTrail logs for debugging and monitoring. The complete user agent string provides essential context for: