Skip to content

fix(bedrock): call lazy_deps.ensure before importing boto3#25088

Closed
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/24967-bedrock-lazy-deps
Closed

fix(bedrock): call lazy_deps.ensure before importing boto3#25088
ms-alan wants to merge 1 commit into
NousResearch:mainfrom
ms-alan:fix/24967-bedrock-lazy-deps

Conversation

@ms-alan

@ms-alan ms-alan commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

.require_boto3() now calls lazy_deps.ensure('provider.bedrock') before attempting to import boto3. Without this, a fresh install that has boto3 as a lazy dep would produce a cryptic ImportError instead of triggering the lazy installation flow.

Fix

agent/bedrock_adapter.py: Call lazy_deps.ensure('provider.bedrock') inside _require_boto3() before the import boto3 line. This matches the pattern used by other lazy-dep providers.

Closes #24967

.require_boto3() now calls lazy_deps.ensure('provider.bedrock') before
attempting to import boto3. Without this, a fresh install that has
boto3 as a lazy dep would produce a cryptic ImportError instead of
triggering the lazy installation flow.

Closes NousResearch#24967
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/bedrock AWS Bedrock (boto3, IAM) labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate fix of #24972, which already addresses #24967 (bedrock _require_boto3 skipping lazy_deps.ensure).

@teknium1

Copy link
Copy Markdown
Contributor

This has been implemented on current main.

Automated hermes-sweeper review evidence:

  • agent/bedrock_adapter.py:46 imports tools.lazy_deps.ensure, and agent/bedrock_adapter.py:47 calls ensure("provider.bedrock", prompt=False) before the adapter's _require_boto3() path imports boto3.
  • tools/lazy_deps.py:83 registers provider.bedrock as boto3==1.42.89, which is the lazy dependency this PR intended to trigger.
  • The implementing commit is c02606a385bd03630b7c76b72bf82f686a51f907 (chore(deps): lazy-install boto3/botocore for bedrock adapter), included in v2026.5.28 and later tags.
  • The prior maintainer discussion on this PR also identified it as a duplicate fix for [Bug]: Bedrock first-call fails with manual-install message — _require_boto3 never calls lazy_deps.ensure #24967.

Thanks for the focused fix. The behavior is already present on main, so this PR can be closed as implemented.

@teknium1 teknium1 closed this Jun 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/bedrock AWS Bedrock (boto3, IAM) sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bedrock first-call fails with manual-install message — _require_boto3 never calls lazy_deps.ensure

3 participants