# NousResearch/hermes-agent · Bedrock converse_stream boto3 version compatibility guard

## Open now

- Nothing open on GitHub.

These issues and PRs address an AttributeError raised when using converse_stream with a boto3 version older than 1.34.59, and add a version check to guard against it.

## TL;DR

- 4 member(s): 0 open issue(s), 2 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #46633. Verify it addresses your case.
- **Recommended:** read PR #46633 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-46633`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.39`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #46592: bedrock: \`converse_stream\` AttributeError when boto3 < 1.34.59 installed system-wide
- #46888: bedrock: \`converse_stream\` AttributeError when boto3 < 1.34.59 installed system-wide

## Prior & competing PRs

- **#46633: fix(bedrock): check boto3 version before Converse streaming**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/bedrock_adapter.py`, `tests/agent/test_bedrock_adapter.py`
  - fix hunks:
  - `agent/bedrock_adapter.py`

    ```diff
    @@ -58,17 +58,34 @@
     _bedrock_control_client_cache: Dict[str, Any] = {}
     
     
    +_MIN_BOTO3_VERSION = (1, 34, 59)
    +
    +
     def _require_boto3():
    -    """Import boto3, raising a clear error if not installed."""
    +    """Import boto3, raising a clear error if not installed or too old."""
         try:
             import boto3
    -        return boto3
         except ImportError:
             raise ImportError(
                 "The 'boto3' package is required for the AWS Bedrock provider. "
                 "Install it with: pip install boto3\n"
                 "Or install Hermes with Bedrock support: pip install -e '.[bedrock]'"
             )
    +    # converse() / converse_stream() were added in boto3 1.34.59.
    +    # When Hermes is installed editable into system Python, the system boto3
    +    # (e.g. Ubuntu 24.04 ships 1.34.46) may take precedence over the venv
    +    # version pinned in pyproject.toml.
    +    try:
    +        version = tuple(int(x) for x in boto3.__version__.split(".")[:3])
    +    except (AttributeError, ValueError):
    +        return boto3  # can't parse — don't block on version check
    +    if version < _MIN_BOTO3_VERSION:
    +        raise RuntimeError(
    +            f"boto3 {boto3.__version__} does not support converse_stream "
    +            f"(minimum 1.34.59 required). Upgrade with: "
    +            f"pip install --upgrade boto3"
    +        )
    +    return boto3
     
     
     def _get_bedrock_runtime_client(region: str):
    ```
  - `tests/agent/test_bedrock_adapter.py`

    ```diff
    @@ -1663,3 +1663,52 @@ def test_falls_back_to_converse_on_streaming_denial(self):
             assert result.choices[0].message.content == "hi"
             # Not a stale connection — client stays cached.
             assert _bedrock_runtime_client_cache.get("us-east-1") is client
    +
    +
    +# ---------------------------------------------------------------------------
    +# boto3 version check
    +# ---------------------------------------------------------------------------
    +
    +
    +class TestRequireBoto3VersionCheck:
    +    """Test that _require_boto3() rejects boto3 versions older than 1.34.59."""
    +
    +    def test_raises_runtime_error_when_boto3_too_old(self):
    +        """boto3 < 1.34.59 should raise RuntimeError with upgrade instructions."""
    +        from agent.bedrock_adapter import _require_boto3
    +
    +        fake_boto3 = MagicMock()
    +        fake_boto3.__version__ = "1.34.46"
    +        with patch.dict("sys.modules", {"boto3": fake_boto3}):
    +            with pytest.raises(RuntimeError, match="does not support converse_stream"):
    +                _require_boto3()
    +
    +    def test_accepts_boto3_at_minimum_version(self):
    +        """boto3 == 1.34.59 should be accepted."""
    +        from agent.bedrock_adapter import _require_boto3
    +
    +        fake_boto3 = MagicMock()
    +        fake_boto3.__version__ = "1.34.59"
    +        with patch.dict("sys.modules", {"boto3": fake_boto3}):
    +            result = _require_boto3()
    +            assert result is fake_boto3
    +
    +    def test_accepts_newer_boto3(self):
    +        """boto3 > 1.34.59 should be accepted."""
    +        from agent.bedrock_adapter import _require_boto3
    +
    +        fake_boto3 = MagicMock()
    +        fake_boto3.__version__ = "1.42.89"
    +        with patch.dict("sys.modules", {"boto3": fake_boto3}):
    +            result = _require_boto3()
    +            assert result is fake_boto3
    +
    +    def test_accepts_boto3_with_unparseable_version(self):
    +        """If version string can't be parsed, don't block on version check."""
    +        from agent.bedrock_adapter import _require_boto3
    +
    +        fake_boto3 = MagicMock()
    +        fake_boto3.__version__ = "dev"
    +        with patch.dict("sys.modules", {"boto3": fake_boto3}):
    +            result = _require_boto3()
    +            assert result is fake_boto3
    ```
- **#46608: fix(bedrock): check boto3 version >= 1.34.59 before using converse_stream**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#46633`

## Fix status

- Merged to main in PR #46633 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-06-15`.
