-
Notifications
You must be signed in to change notification settings - Fork 499
Description
Checks
- I have updated to the lastest minor and patch version of Strands
- I have checked the documentation and this is not expected behavior
- I have searched ./issues and there are no duplicates of my issue
Strands Version
1.10.0
Python Version
3.13.5
Operating System
macOS Sequoia 15.7
Installation Method
pip
Steps to Reproduce
- Import Strands:
from strands import Agent; from strands.multiagent import Swarm - Create any agent with non-Bedrock model:
agent = Agent(model=some_ollama_model) - Create Swarm:
swarm = Swarm([agent]) - Observe AWS service calls in logs despite using only Ollama models (attempt to connect to IMDS endpoint on http://169.254.169.254/, evalutation of AWS creds env vars. Issue appears to be in Swarm init where it creates a default Agent which will try and instantiate a default BedrockModel with Claude which result in the errors because environment is only using ollama and no AWS)
Expected Behavior
No AWS service calls should occur when using swarms with only non-Bedrock model providers like Ollama.
Actual Behavior
AWS credential resolution is attempted and BedrockModel initialization occurs, causing timeout errors and unnecessary AWS service calls, even though all agents in the swarm use OllamaModel (attempt to connect to IMDS endpoint on http://169.254.169.254/, evalutation of AWS creds env vars. Issue appears to be in Swarm init where it creates a default Agent which will try and instantiate a default BedrockModel with Claude which result in the errors because environment is only using ollama and no AWS).
Additional Context
Debug analysis shows the issue occurs in Swarm.init() at this line:
self.state = SwarmState(
current_node=SwarmNode("", Agent()), # <-- Agent() defaults to BedrockModel
task="",
completion_status=Status.PENDING,
)This placeholder Agent is never used but triggers BedrockModel initialization immediately.
Possible Solution
Use a null model for the placeholder Agent or delay SwarmState creation until after _setup_swarm() when real agents are available.
Related Issues
No response