hermes - ✅(Solved) Fix [Bug]: Bedrock first-call fails with manual-install message — _require_boto3 never calls lazy_deps.ensure [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#24967Fetched 2026-05-14 03:50:14
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2

Error Message

Error: The 'boto3' package is required for the AWS Bedrock provider. model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 2026-05-13 18:30:36,952 ERROR [20260513_183020_9d619a] root: API call failed after 3 retries. The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3

Additional Logs / Traceback (optional)

Mirror the _get_anthropic_sdk pattern in _require_boto3: call tools.lazy_deps.ensure("provider.bedrock", prompt=False) inside a try/except (tolerating ImportError if lazy_deps is unavailable and generic Exception for FeatureUnavailable when lazy installs are opted-out/offline) before the import boto3 attempt, preserving the existing ImportError message as the final fallback.

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #24972: fix(bedrock): route _require_boto3 through lazy_deps.ensure

Description (problem / solution / changelog)

What does this PR do?

Restores the lazy-install path for boto3. The 2026-05-12 supply-chain-hardening pass (#24515) relocated boto3 from the [all] extra into LAZY_DEPS["provider.bedrock"], but agent/bedrock_adapter.py::_require_boto3 was not updated alongside the other adapters and still does a bare try: import boto3 / except ImportError: raise. Fresh installs therefore hit the manual-install error on the very first Bedrock call, even with security.allow_lazy_installs left at the default true.

This PR mirrors the pattern already used by agent/anthropic_adapter.py::_get_anthropic_sdk — call tools.lazy_deps.ensure("provider.bedrock", prompt=False) before the import, swallowing ImportError (the tools.lazy_deps module itself unavailable — e.g. minimal packaging) and generic Exception (FeatureUnavailable when the user has opted out of lazy installs or is offline). The existing manual-install ImportError survives as the final fallback when lazy install is unavailable or fails.

Related Issue

Fixes #24967

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • agent/bedrock_adapter.py_require_boto3() now calls tools.lazy_deps.ensure("provider.bedrock", prompt=False) before the import boto3 attempt, matching _get_anthropic_sdk in anthropic_adapter.py.
  • tests/agent/test_bedrock_adapter.py — new TestRequireBoto3LazyInstall class:
    • test_require_boto3_calls_ensure_provider_bedrock patches tools.lazy_deps.ensure and asserts it is called with ("provider.bedrock", prompt=False).
    • test_require_boto3_tolerates_ensure_failure confirms the import still succeeds when ensure() itself raises (FeatureUnavailable fallback).
    • Both tests stub boto3 via patch.dict(sys.modules, {"boto3": <fake>}) so they run in the minimal CI environment that #24515 / #24601 established (i.e. without the real boto3 installed).

How to Test

  1. On a clean venv with no boto3 installed and security.allow_lazy_installs at the default true, configure the Bedrock provider and start a chat.
  2. The first user message should trigger tools.lazy_deps.ensure → pip-install boto3==1.42.89 → normal Converse call, not the manual-install ImportError.
  3. Focused regression (with and without boto3):
    # with boto3 present
    pytest tests/agent/test_bedrock_adapter.py::TestRequireBoto3LazyInstall -v
    # 2 passed
    
    # without boto3 (matches CI environment)
    uv pip uninstall boto3 botocore
    pytest tests/agent/test_bedrock_adapter.py::TestRequireBoto3LazyInstall -v
    # 2 passed
  4. Adjacent suites still green:
    pytest tests/agent/test_bedrock_adapter.py tests/tools/test_lazy_deps.py
    # 163 passed

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, test(scope):)
  • I searched for existing PRs to make sure this isn't a duplicate (#24601 is an adjacent CI-fix PR but doesn't touch _require_boto3)
  • My PR contains only changes related to this fix (no unrelated commits)
  • I've run the affected test suites and all tests pass (pytest tests/agent/test_bedrock_adapter.py tests/tools/test_lazy_deps.py → 163 passed, both with and without boto3 installed)
  • I've added tests for my changes
  • I've tested on my platform: macOS 15 (Darwin 25.2.0)

Documentation & Housekeeping

  • I've updated relevant documentation — N/A (no user-facing doc changes)
  • I've updated cli-config.yaml.example — N/A (no config keys changed)
  • I've updated CONTRIBUTING.md or AGENTS.md — N/A (no architecture change)
  • I've considered cross-platform impact — N/A (pure-Python import path, same on Linux/macOS/Windows)
  • I've updated tool descriptions/schemas — N/A (no tool behavior change)

Screenshots / Logs

Before this PR, on a fresh install with security.allow_lazy_installs: true (default):

API call failed (attempt 1/3): ImportError
   Provider: bedrock  Model: arn:aws:bedrock:us-west-2:<REDACTED>:application-inference-profile/<REDACTED>
   Endpoint: https://bedrock-runtime.us-east-1.amazonaws.com
   Error: The 'boto3' package is required for the AWS Bedrock provider.
          Install it with: pip install boto3
          Or install Hermes with Bedrock support: pip install -e '.[bedrock]'

The retry loop exhausts without ever attempting a lazy install. Also reproduced earlier in the session from the model-discovery path:

WARNING agent.bedrock_adapter: Failed to create Bedrock client for model discovery:
The 'boto3' package is required for the AWS Bedrock provider. ...

Both paths go through _require_boto3, so the single-point fix in this PR resolves discovery and chat together.

Changed files

  • agent/bedrock_adapter.py (modified, +16/-1)
  • tests/agent/test_bedrock_adapter.py (modified, +55/-0)

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

Description (problem / solution / changelog)

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

Changed files

  • agent/bedrock_adapter.py (modified, +4/-0)

Code Example

============================================================
  FULL agent.log
  ============================================================

  [hermes debug share: log content redacted at upload time. run with --no-redact to disable]
  --- hermes dump ---
  version:          0.13.0 (2026.5.7) [942adf61]
  os:               Darwin 25.2.0 arm64
  python:           3.11.15
  openai_sdk:       2.24.0
  profile:          default
  hermes_home:      ~/.hermes
  model:            arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE>
  provider:         bedrock
  terminal:         local

  api_keys:
    openrouter           not set
    openai               not set
    anthropic            not set
    anthropic_token      not set
    nous                 not set
    google/gemini        not set
    gemini               not set
    glm/zai              not set
    zai                  not set
    kimi                 not set
    minimax              not set
    deepseek             not set
    dashscope            not set
    huggingface          not set
    nvidia               not set
    ai_gateway           not set
    opencode_zen         not set
    opencode_go          not set
    kilocode             not set
    firecrawl            not set
    tavily               not set
    browserbase          not set
    fal                  not set
    elevenlabs           not set
    github               not set

  features:
    toolsets:           hermes-cli
    mcp_servers:        0
    memory_provider:    built-in
    gateway:            stopped (launchd)
    platforms:          none
    cron_jobs:          0
    skills:             87

  config_overrides:
    display.streaming: True
  --- end dump ---


  --- full agent.log ---
  2026-05-13 16:46:45,564 WARNING agent.bedrock_adapter: Failed to create Bedrock client for model discovery: The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:19,613 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:19,615 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:19,616 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:21,458 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:23,861 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:26,170 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:47:26,974 INFO tools.lazy_deps: Lazy-installing edge-tts==7.2.7 for feature 'tts.edge'
  2026-05-13 16:47:29,296 INFO tools.lazy_deps: Lazy install complete for feature 'tts.edge'
  2026-05-13 16:47:29,515 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:47:41,035 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:41,035 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:41,036 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:41,153 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:41,906 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:47:42,391 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:47:44,362 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:47:44,363 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 16:47:44,366 INFO [20260513_164742_218501] run_agent: conversation turn: session=20260513_164742_218501 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 16:47:44,488 WARNING [20260513_164742_218501] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:44,488 WARNING [20260513_164742_218501] run_agent: Retrying API call in 2.444734520593183s (attempt 1/3) thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:47,121 WARNING [20260513_164742_218501] run_agent: API call failed (attempt 2/3) error_type=ImportError thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:47,122 WARNING [20260513_164742_218501] run_agent: Retrying API call in 4.2524777061747905s (attempt 2/3) thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:49,348 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:47:49,348 INFO agent.auxiliary_client: Auxiliary title_generation: provider auto unavailable, trying auto-detection chain
  2026-05-13 16:49:20,872 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:49:20,873 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:49:20,873 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:49:21,029 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:49:21,805 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:49:22,289 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:49:23,456 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:23,457 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 16:49:23,460 INFO [20260513_164922_96c02f] run_agent: conversation turn: session=20260513_164922_96c02f model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 16:49:23,559 WARNING [20260513_164922_96c02f] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6249885696 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:49:23,561 WARNING [20260513_164922_96c02f] run_agent: Retrying API call in 2.940416728740643s (attempt 1/3) thread=Thread-5 (run_agent):6249885696 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:49:25,317 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:25,317 INFO agent.auxiliary_client: Auxiliary title_generation: provider auto unavailable, trying auto-detection chain
  2026-05-13 16:49:25,402 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:25,402 WARNING agent.title_generator: Title generation failed: No LLM provider configured for task=title_generation provider=auto. Run: hermes setup
  2026-05-13 18:29:01,728 WARNING agent.bedrock_adapter: Failed to create Bedrock client for model discovery: The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:29:18,268 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 18:29:18,269 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 18:29:18,270 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 18:29:20,292 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 18:30:17,775 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 18:30:17,776 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 18:30:17,776 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 18:30:17,879 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 18:30:20,283 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 18:30:20,926 INFO tools.lazy_deps: Lazy-installing edge-tts==7.2.7 for feature 'tts.edge'
  2026-05-13 18:30:22,838 INFO tools.lazy_deps: Lazy install complete for feature 'tts.edge'
  2026-05-13 18:30:23,024 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 18:30:29,912 INFO tools.tirith_security: cosign not on PATH — installing tirith with SHA-256 verification only (install cosign for full supply chain verification)
  2026-05-13 18:30:29,998 INFO tools.tirith_security: tirith installed to /Users/<USER>/.hermes/bin/tirith (SHA-256 only)
  2026-05-13 18:30:30,564 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 18:30:30,565 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 18:30:30,568 INFO [20260513_183020_9d619a] run_agent: conversation turn: session=20260513_183020_9d619a model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 18:30:30,626 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:30,628 WARNING [20260513_183020_9d619a] run_agent: Retrying API call in 2.1583524975424067s (attempt 1/3) thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:32,872 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 2/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:32,873 WARNING [20260513_183020_9d619a] run_agent: Retrying API call in 4.044737095593005s (attempt 2/3) thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:36,950 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 3/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:36,952 ERROR [20260513_183020_9d619a] root: API call failed after 3 retries. The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]' | provider=bedrock model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> msgs=2 tokens=~3,658
  2026-05-13 18:50:00,737 INFO hermes_cli.debug: hermes debug share: applied force-mode redaction to log snapshots before upload

---
RAW_BUFFERClick to expand / collapse

Bug Description

Fresh install via install.sh (uv sync --extra all --locked) leaves boto3 uninstalled, as expected per the 2026-05-12 supply-chain-hardening policy that moved boto3 from the [all] extra into LAZY_DEPS["provider.bedrock"].

On the first Bedrock API call, however, Hermes does NOT trigger the lazy install. It prints the manual-install fallback instead, meaning every fresh install is broken for Bedrock users until they manually pip install boto3 — even with security.allow_lazy_installs left at the default (true).

Steps to Reproduce

  1. On a clean box with no boto3 installed, run install.sh.
  2. Configure the Bedrock provider (hermes setup → pick bedrock).
  3. Start a chat and send any message.
  4. Observe the manual-install ImportError message in the retry loop.

Expected Behavior

Per the policy comment in pyproject.toml above the [all] extra:

"Anything an opt-in backend ... MUST live exclusively in LAZY_DEPS
 and resolve at first use"

the first Bedrock call should route through tools.lazy_deps.ensure("provider.bedrock"), which auto-installs boto3==1.42.89 into the active venv, and the chat should proceed normally.

Actual Behavior

API call failed (attempt 1/3): ImportError Provider: bedrock Model: arn:aws:bedrock:us-west-2:<REDACTED>:application-inference-profile/<REDACTED> Endpoint: https://bedrock-runtime.us-east-1.amazonaws.com Error: The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3 Or install Hermes with Bedrock support: pip install -e '.[bedrock]' Retrying in 2.2s (attempt 1/3)...

Affected Component

CLI (interactive chat), Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

============================================================
  FULL agent.log
  ============================================================

  [hermes debug share: log content redacted at upload time. run with --no-redact to disable]
  --- hermes dump ---
  version:          0.13.0 (2026.5.7) [942adf61]
  os:               Darwin 25.2.0 arm64
  python:           3.11.15
  openai_sdk:       2.24.0
  profile:          default
  hermes_home:      ~/.hermes
  model:            arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE>
  provider:         bedrock
  terminal:         local

  api_keys:
    openrouter           not set
    openai               not set
    anthropic            not set
    anthropic_token      not set
    nous                 not set
    google/gemini        not set
    gemini               not set
    glm/zai              not set
    zai                  not set
    kimi                 not set
    minimax              not set
    deepseek             not set
    dashscope            not set
    huggingface          not set
    nvidia               not set
    ai_gateway           not set
    opencode_zen         not set
    opencode_go          not set
    kilocode             not set
    firecrawl            not set
    tavily               not set
    browserbase          not set
    fal                  not set
    elevenlabs           not set
    github               not set

  features:
    toolsets:           hermes-cli
    mcp_servers:        0
    memory_provider:    built-in
    gateway:            stopped (launchd)
    platforms:          none
    cron_jobs:          0
    skills:             87

  config_overrides:
    display.streaming: True
  --- end dump ---


  --- full agent.log ---
  2026-05-13 16:46:45,564 WARNING agent.bedrock_adapter: Failed to create Bedrock client for model discovery: The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:19,613 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:19,615 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:19,616 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:21,458 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:23,748 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:23,861 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:26,170 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:47:26,974 INFO tools.lazy_deps: Lazy-installing edge-tts==7.2.7 for feature 'tts.edge'
  2026-05-13 16:47:29,296 INFO tools.lazy_deps: Lazy install complete for feature 'tts.edge'
  2026-05-13 16:47:29,515 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:47:41,035 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:47:41,035 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:47:41,036 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:47:41,153 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:47:41,906 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:47:42,391 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:47:44,362 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:47:44,363 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 16:47:44,366 INFO [20260513_164742_218501] run_agent: conversation turn: session=20260513_164742_218501 model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 16:47:44,488 WARNING [20260513_164742_218501] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:44,488 WARNING [20260513_164742_218501] run_agent: Retrying API call in 2.444734520593183s (attempt 1/3) thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:47,121 WARNING [20260513_164742_218501] run_agent: API call failed (attempt 2/3) error_type=ImportError thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:47,122 WARNING [20260513_164742_218501] run_agent: Retrying API call in 4.2524777061747905s (attempt 2/3) thread=Thread-5 (run_agent):6183759872 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:47:49,348 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:47:49,348 INFO agent.auxiliary_client: Auxiliary title_generation: provider auto unavailable, trying auto-detection chain
  2026-05-13 16:49:20,872 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 16:49:20,873 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 16:49:20,873 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 16:49:21,029 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 16:49:21,805 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 16:49:22,289 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 16:49:23,456 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:23,457 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 16:49:23,460 INFO [20260513_164922_96c02f] run_agent: conversation turn: session=20260513_164922_96c02f model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 16:49:23,559 WARNING [20260513_164922_96c02f] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6249885696 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:49:23,561 WARNING [20260513_164922_96c02f] run_agent: Retrying API call in 2.940416728740643s (attempt 1/3) thread=Thread-5 (run_agent):6249885696 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 16:49:25,317 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:25,317 INFO agent.auxiliary_client: Auxiliary title_generation: provider auto unavailable, trying auto-detection chain
  2026-05-13 16:49:25,402 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 16:49:25,402 WARNING agent.title_generator: Title generation failed: No LLM provider configured for task=title_generation provider=auto. Run: hermes setup
  2026-05-13 18:29:01,728 WARNING agent.bedrock_adapter: Failed to create Bedrock client for model discovery: The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:29:18,268 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 18:29:18,269 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 18:29:18,270 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 18:29:20,292 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 18:30:17,775 INFO hermes_cli.plugins: Plugin 'openai' registered image_gen provider: openai
  2026-05-13 18:30:17,776 INFO hermes_cli.plugins: Plugin 'openai-codex' registered image_gen provider: openai-codex
  2026-05-13 18:30:17,776 INFO hermes_cli.plugins: Plugin 'xai' registered image_gen provider: xai
  2026-05-13 18:30:17,879 INFO hermes_cli.plugins: Plugin discovery complete: 12 found, 8 enabled
  2026-05-13 18:30:20,283 INFO run_agent: Loaded environment variables from /Users/<USER>/.hermes/.env
  2026-05-13 18:30:20,926 INFO tools.lazy_deps: Lazy-installing edge-tts==7.2.7 for feature 'tts.edge'
  2026-05-13 18:30:22,838 INFO tools.lazy_deps: Lazy install complete for feature 'tts.edge'
  2026-05-13 18:30:23,024 INFO tools.tirith_security: tirith not found — downloading latest release for aarch64-apple-darwin...
  2026-05-13 18:30:29,912 INFO tools.tirith_security: cosign not on PATH — installing tirith with SHA-256 verification only (install cosign for full supply chain verification)
  2026-05-13 18:30:29,998 INFO tools.tirith_security: tirith installed to /Users/<USER>/.hermes/bin/tirith (SHA-256 only)
  2026-05-13 18:30:30,564 WARNING agent.auxiliary_client: Auxiliary auto-detect: no provider available (tried: openrouter, nous, local/custom, api-key). Compression, summarization, and memory flush will not work. Set OPENROUTER_API_KEY or configure a local model in config.yaml.
  2026-05-13 18:30:30,565 WARNING run_agent: No auxiliary LLM provider for compression — summaries will be unavailable.
  2026-05-13 18:30:30,568 INFO [20260513_183020_9d619a] run_agent: conversation turn: session=20260513_183020_9d619a model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> provider=bedrock platform=cli history=0 msg='hi'
  2026-05-13 18:30:30,626 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 1/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:30,628 WARNING [20260513_183020_9d619a] run_agent: Retrying API call in 2.1583524975424067s (attempt 1/3) thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:32,872 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 2/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:32,873 WARNING [20260513_183020_9d619a] run_agent: Retrying API call in 4.044737095593005s (attempt 2/3) thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> error=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:36,950 WARNING [20260513_183020_9d619a] run_agent: API call failed (attempt 3/3) error_type=ImportError thread=Thread-5 (run_agent):6186905600 provider=bedrock base_url=https://bedrock-runtime.us-east-1.amazonaws.com
  model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> summary=The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]'
  2026-05-13 18:30:36,952 ERROR [20260513_183020_9d619a] root: API call failed after 3 retries. The 'boto3' package is required for the AWS Bedrock provider. Install it with: pip install boto3
  Or install Hermes with Bedrock support: pip install -e '.[bedrock]' | provider=bedrock model=arn:aws:bedrock:us-west-2:<REDACTED_ACCOUNT>:application-inference-profile/<REDACTED_PROFILE> msgs=2 tokens=~3,658
  2026-05-13 18:50:00,737 INFO hermes_cli.debug: hermes debug share: applied force-mode redaction to log snapshots before upload

Operating System

macOS 15

Python Version

3.11.15

Hermes Version

v0.13.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

agent/bedrock_adapter.py:48-58 — _require_boto3() is the single gateway for all boto3 access in the adapter, but it does a bare try: import boto3 / except ImportError: raise ImportError(...manual install...) and never calls tools.lazy_deps.ensure("provider.bedrock").

This call site was missed in the 2026-05-12 refactor that relocated boto3 from the [all] extra to LAZY_DEPS. Compare with agent/anthropic_adapter.py:34-51 _get_anthropic_sdk(), which correctly calls _lazy_ensure("provider.anthropic", prompt=False) before the import.

Proposed Fix (optional)

Mirror the _get_anthropic_sdk pattern in _require_boto3: call tools.lazy_deps.ensure("provider.bedrock", prompt=False) inside a try/except (tolerating ImportError if lazy_deps is unavailable and generic Exception for FeatureUnavailable when lazy installs are opted-out/offline) before the import boto3 attempt, preserving the existing ImportError message as the final fallback.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: Bedrock first-call fails with manual-install message — _require_boto3 never calls lazy_deps.ensure [2 pull requests, 1 participants]