Summary
bedrock_agentcore.memory.integrations.strands.session_manager fails to import against the current release of strands-agents (1.56.0), which makes the Strands memory integration unusable on a default uv/pip resolution.
strands-agents is not declared as a dependency of bedrock-agentcore, so no resolver can prevent the incompatible pairing — installs silently succeed and fail at runtime.
Reproduction
# pyproject.toml — a default AgentCore CLI scaffold
dependencies = [
"bedrock-agentcore >= 1.9.1",
"strands-agents >= 1.15.0",
]
$ uv sync # resolves bedrock-agentcore 1.23.0 + strands-agents 1.56.0
$ python -c "from bedrock_agentcore.memory.integrations.strands.session_manager import AgentCoreMemorySessionManager"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../bedrock_agentcore/memory/integrations/strands/session_manager.py", line 14, in <module>
from strands.experimental.hooks.events import (
...<3 lines>...
)
ImportError: cannot import name 'BidiAfterInvocationEvent' from 'strands.experimental.hooks.events'
Root cause
src/bedrock_agentcore/memory/integrations/strands/session_manager.py (lines 14–18) imports:
from strands.experimental.hooks.events import (
BidiAfterInvocationEvent,
BidiAgentInitializedEvent,
BidiMessageAddedEvent,
)
In strands-agents 1.56.0, strands/experimental/hooks/events.py became a deprecation shim that re-exports only four renamed aliases via a module-level __getattr__ and raises AttributeError for anything else. The bidi hook events moved to strands/experimental/bidi/hooks/events.py, and these three names do not appear anywhere in the 1.56.0 package under any module — they appear to have been removed or renamed rather than relocated.
Affected versions
Verified by resolving each pair and importing:
bedrock-agentcore |
with strands-agents 1.56.0 |
| 1.9.1, 1.10.0, 1.11.0 |
imports cleanly (no import from that module) |
| 1.12.0 → 1.23.0 (all 15 releases) |
ImportError |
Every bedrock-agentcore release from 1.12.0 onward is broken against the current strands-agents. strands-agents 1.30.0 → 1.55.1 all carry the three symbols, so 1.56.0 is the only release that triggers it.
Impact
The failure surfaces confusingly on AgentCore Runtime. The ImportError occurs at module load, so the container never starts and the service reports:
Runtime initialization time exceeded. Please make sure that initialization completes in 30s.
followed by 502 on retry. That reads as a cold-start/timeout problem, so the actual cause is only visible in the runtime's CloudWatch logs. We lost meaningful time to this before finding the traceback.
Notable detail
All three symbols are used only as registry keys inside register_hooks:
registry.add_callback(BidiAgentInitializedEvent, lambda event: self.initialize_bidi_agent(event.agent))
registry.add_callback(BidiMessageAddedEvent, _on_bidi_message_added)
registry.add_callback(BidiAfterInvocationEvent, _offload(self.sync_bidi_agent, lambda e: e.agent))
They are never instantiated, subclassed, or isinstance-checked, and they only dispatch for a BidiAgent loop. So for non-bidirectional agents the import is the only thing that fails — the functionality behind it is never exercised.
Suggested fixes
Any one of these would resolve it; the first is the most valuable regardless:
- Declare the dependency.
bedrock-agentcore currently declares boto3, botocore, pydantic, starlette, typing-extensions, urllib3, uvicorn, websockets — no strands-agents. Adding it as an optional/extra dependency with a version bound would let resolvers reject impossible pairings instead of failing at runtime.
- Import from the new location when available, e.g. try
strands.experimental.bidi.hooks.events and fall back to strands.experimental.hooks.events.
- Guard the bidi imports so a missing bidi hook surface degrades to "bidi sync unavailable" rather than breaking all memory-integration usage for non-bidi agents.
Environment
bedrock-agentcore 1.23.0
strands-agents 1.56.0
mcp 1.24.0
- Python 3.14, AgentCore CLI 0.29.0 and 0.30.0 (both scaffold identical dependency specs)
- AgentCore Runtime,
us-west-2
Summary
bedrock_agentcore.memory.integrations.strands.session_managerfails to import against the current release ofstrands-agents(1.56.0), which makes the Strands memory integration unusable on a defaultuv/pipresolution.strands-agentsis not declared as a dependency ofbedrock-agentcore, so no resolver can prevent the incompatible pairing — installs silently succeed and fail at runtime.Reproduction
Root cause
src/bedrock_agentcore/memory/integrations/strands/session_manager.py(lines 14–18) imports:In
strands-agents1.56.0,strands/experimental/hooks/events.pybecame a deprecation shim that re-exports only four renamed aliases via a module-level__getattr__and raisesAttributeErrorfor anything else. The bidi hook events moved tostrands/experimental/bidi/hooks/events.py, and these three names do not appear anywhere in the 1.56.0 package under any module — they appear to have been removed or renamed rather than relocated.Affected versions
Verified by resolving each pair and importing:
bedrock-agentcorestrands-agents1.56.0Every
bedrock-agentcorerelease from 1.12.0 onward is broken against the currentstrands-agents.strands-agents1.30.0 → 1.55.1 all carry the three symbols, so 1.56.0 is the only release that triggers it.Impact
The failure surfaces confusingly on AgentCore Runtime. The ImportError occurs at module load, so the container never starts and the service reports:
followed by
502on retry. That reads as a cold-start/timeout problem, so the actual cause is only visible in the runtime's CloudWatch logs. We lost meaningful time to this before finding the traceback.Notable detail
All three symbols are used only as registry keys inside
register_hooks:They are never instantiated, subclassed, or
isinstance-checked, and they only dispatch for aBidiAgentloop. So for non-bidirectional agents the import is the only thing that fails — the functionality behind it is never exercised.Suggested fixes
Any one of these would resolve it; the first is the most valuable regardless:
bedrock-agentcorecurrently declaresboto3, botocore, pydantic, starlette, typing-extensions, urllib3, uvicorn, websockets— nostrands-agents. Adding it as an optional/extra dependency with a version bound would let resolvers reject impossible pairings instead of failing at runtime.strands.experimental.bidi.hooks.eventsand fall back tostrands.experimental.hooks.events.Environment
bedrock-agentcore1.23.0strands-agents1.56.0mcp1.24.0us-west-2