Skip to content

fix: resolve crash on all commands due to missing @aws-sdk/region-config-resolver#1276

Merged
jesseturner21 merged 2 commits into
mainfrom
fix/version-crash-missing-region-config-resolver
May 15, 2026
Merged

fix: resolve crash on all commands due to missing @aws-sdk/region-config-resolver#1276
jesseturner21 merged 2 commits into
mainfrom
fix/version-crash-missing-region-config-resolver

Conversation

@jesseturner21
Copy link
Copy Markdown
Contributor

@jesseturner21 jesseturner21 commented May 15, 2026

Summary

  • @aws-cdk/toolkit-lib@1.25.2 depends on @aws-sdk/client-sts@^3, which now resolves to 3.1048.0. That version removed @aws-sdk/region-config-resolver from its dependencies, but toolkit-lib's bundled CJS still requires it — causing every agentcore command to crash on fresh install.
  • Adds @aws-sdk/region-config-resolver as a direct dependency so it's always available.
  • Adds early --version interception in the entrypoint to avoid loading heavy deps for version checks.

Test plan

  • npm install -g . then agentcore --version prints version without error
  • agentcore status --help loads without crash
  • npm test passes

@aws-cdk/toolkit-lib's bundled CJS requires @aws-sdk/region-config-resolver,
but @aws-sdk/client-sts@3.1048.0 dropped it as a dependency. Adding it as a
direct dep ensures it's always available in node_modules.

Also adds early --version interception in the entrypoint to avoid loading
heavy dependencies for a simple version check.

Constraint: Cannot pin @aws-cdk/toolkit-lib's transitive SDK versions
Rejected: Pin client-sts to <3.1048.0 | would block all SDK updates
Confidence: high
Scope-risk: narrow
@jesseturner21 jesseturner21 requested a review from a team May 15, 2026 19:33
@github-actions github-actions Bot added size/xs PR size: XS agentcore-harness-reviewing AgentCore Harness review in progress labels May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.13.1.tgz

How to install

npm install https://github.com/aws/agentcore-cli/releases/download/pr-1276-tarball/aws-agentcore-0.13.1.tgz

@github-actions github-actions Bot added size/xs PR size: XS and removed size/xs PR size: XS labels May 15, 2026
Copy link
Copy Markdown

@agentcore-cli-automation agentcore-cli-automation left a comment

Choose a reason for hiding this comment

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

LGTM. The fix is small and correct: pulling @aws-sdk/region-config-resolver up to a direct dependency of @aws/agentcore ensures npm hoists it into top-level node_modules, where toolkit-lib's bundled CJS require('@aws-sdk/region-config-resolver') will resolve it after @aws-sdk/client-sts@3.1048.0 dropped it as a transitive dep.

I verified the root cause against the npm registry: @aws-sdk/client-sts@3.1047.0 lists @aws-sdk/region-config-resolver as a dependency, but 3.1048.0 (current latest) does not, while @aws-cdk/toolkit-lib's bundle still requires it.

Nice that the early --version short-circuit was dropped in 3b66758 — since src/cli/index.ts statically imports ./cli.js (which imports @aws-cdk/toolkit-lib transitively via cdk/toolkit-lib/wrapper.ts), ESM hoisting + esbuild bundling means those imports are evaluated before any top-level statement runs, so the short-circuit couldn't actually have avoided loading the heavy deps. Glad that's gone.

Two minor things worth mentioning (non-blocking, your call):

  • The PR description still mentions the early --version interception that was removed — might be worth updating before merge so the commit history reflects what actually shipped.
  • This is effectively a workaround for an upstream issue (toolkit-lib's bundle not declaring region-config-resolver as a direct dep). A short comment in package.json or a tracking issue link would help future maintainers know when it's safe to remove this direct dep.

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.71% 9266 / 21196
🔵 Statements 42.97% 9837 / 22891
🔵 Functions 40.36% 1593 / 3946
🔵 Branches 40.49% 6043 / 14921
Generated in workflow #3028 for commit 3b66758 by the Vitest Coverage Report Action

@jesseturner21 jesseturner21 merged commit 7acd86e into main May 15, 2026
27 of 29 checks passed
@jesseturner21 jesseturner21 deleted the fix/version-crash-missing-region-config-resolver branch May 15, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants