From c02606a385bd03630b7c76b72bf82f686a51f907 Mon Sep 17 00:00:00 2001 From: hawknewton <211668+hawknewton@users.noreply.github.com> Date: Sun, 17 May 2026 02:29:28 -0700 Subject: [PATCH] chore(deps): lazy-install boto3/botocore for bedrock adapter agent/bedrock_adapter.py now calls lazy_deps to install boto3 and botocore on first import, mirroring how other optional provider adapters defer their heavy AWS dependencies until actually used. Keeps the base install slim for users who don't run on Bedrock. --- agent/bedrock_adapter.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/agent/bedrock_adapter.py b/agent/bedrock_adapter.py index 34eebd73ba8..620d1c99785 100644 --- a/agent/bedrock_adapter.py +++ b/agent/bedrock_adapter.py @@ -36,6 +36,19 @@ from typing import Any, Dict, List, Optional, Tuple logger = logging.getLogger(__name__) +# --------------------------------------------------------------------------- +# Ensure boto3/botocore are installed before any code in this module runs. +# Upstream removed boto3 from [all] extras (PRs #24220, #24515); lazy_deps +# handles on-demand installation so the Bedrock provider still works in the +# EKS deployment without baking boto3 into the base image. +# --------------------------------------------------------------------------- +try: + from tools.lazy_deps import ensure + ensure("provider.bedrock", prompt=False) +except Exception: + pass # lazy_deps unavailable or install failed — let downstream imports surface the real error + + # --------------------------------------------------------------------------- # Lazy boto3 import — only loaded when the Bedrock provider is actually used. # This keeps startup fast for users who don't use Bedrock.