fix(lambda): fix user agent and headers for remote debugging#8304
Merged
laileni-aws merged 14 commits intoaws:masterfrom Nov 19, 2025
Merged
fix(lambda): fix user agent and headers for remote debugging#8304laileni-aws merged 14 commits intoaws:masterfrom
laileni-aws merged 14 commits intoaws:masterfrom
Conversation
Vandita2020
approved these changes
Nov 17, 2025
This prevents future mistakes by exposing a readonly array `customUserAgentBase` in non-readonly arrays in methods such as `getLambdaDebugUserAgentPairs()`
3139d19 to
da91360
Compare
There's a `Visual-Studio-Code---Insiders/` that didn't fit previous test that was checking for `Visual-Studio-Code/` (slash included). Rename some of the errors to make it clearer if there's one failing too.
|
⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done |
|
✅ I finished the code review, and didn't find any security or code quality issues. |
Organize the new tests a bit
roger-zhangg
approved these changes
Nov 18, 2025
ashishrp-aws
approved these changes
Nov 18, 2025
laileni-aws
reviewed
Nov 18, 2025
packages/toolkit/.changes/next-release/Bug Fix-b0864d23-587c-4277-bfc8-deb24684741e.json
Outdated
Show resolved
Hide resolved
laileni-aws
approved these changes
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The AWS SDK v2 to v3 migration in PR #8183 introduced breaking changes for LocalStack compatibility and Lambda debugging is not working anymore:
UserAgentpairs format ([name, version]tuples), but several places still used the old string format, breaking LocalStack's custom user agent for Lambda debugging and part of the integration with IoT$response.httpResponse.headers, breaking LocalStack connection detection which relies on thex-localstack-request-urlheaderThese issues were not caught most likely because LocalStack compatibility was not tested during the SDK v3 migration.
Solution
Fix user agent format for AWS SDK v3
Migrated from string-based user agents to proper UserAgent pairs format:
Updated awsClientBuilderV3 to use customUserAgent instead of userAgent
Add response headers middleware for AWS SDK v3
captureHeadersMiddlewaretoAWSClientBuilderV3that attaches HTTP response headers to the output via$httpHeaderspropertyloginManagerto check for LocalStack connection using$httpHeadersinstead of the removed$response.httpResponse.headersAWS SDK v3 Breaking Changes
User Agent Format
SDK v2:
SDK v3:
Response Headers Access
SDK v2:
SDK v3:
Supersedes #8289 and #8291
feature/xbranches will not be squash-merged at release time.