Skip to content

Commit 48bcd5b

Browse files
chore!: set Agent property load_tools_from_directory to default to False (#419)
BREAKING CHANGE: load_tools_from_directory will now default to False
1 parent 10555be commit 48bcd5b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/strands/agent/agent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def __init__(
199199
] = _DEFAULT_CALLBACK_HANDLER,
200200
conversation_manager: Optional[ConversationManager] = None,
201201
record_direct_tool_call: bool = True,
202-
load_tools_from_directory: bool = True,
202+
load_tools_from_directory: bool = False,
203203
trace_attributes: Optional[Mapping[str, AttributeValue]] = None,
204204
*,
205205
agent_id: Optional[str] = None,
@@ -235,7 +235,7 @@ def __init__(
235235
record_direct_tool_call: Whether to record direct tool calls in message history.
236236
Defaults to True.
237237
load_tools_from_directory: Whether to load and automatically reload tools in the `./tools/` directory.
238-
Defaults to True.
238+
Defaults to False.
239239
trace_attributes: Custom trace attributes to apply to the agent's trace span.
240240
agent_id: Optional ID for the agent, useful for multi-agent scenarios.
241241
If None, a UUID is generated.

src/strands/tools/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def reload_tool(self, tool_name: str) -> None:
361361
logger.exception("tool_name=<%s> | failed to reload tool", tool_name)
362362
raise
363363

364-
def initialize_tools(self, load_tools_from_directory: bool = True) -> None:
364+
def initialize_tools(self, load_tools_from_directory: bool = False) -> None:
365365
"""Initialize all tools by discovering and loading them dynamically from all tool directories.
366366
367367
Args:

tests_integ/test_hot_tool_reload_decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_hot_reload_decorator():
3030

3131
try:
3232
# Create an Agent instance without any tools
33-
agent = Agent()
33+
agent = Agent(load_tools_from_directory=True)
3434

3535
# Create a test tool using @tool decorator
3636
with open(test_tool_path, "w") as f:
@@ -82,7 +82,7 @@ def test_hot_reload_decorator_update():
8282

8383
try:
8484
# Create an Agent instance
85-
agent = Agent()
85+
agent = Agent(load_tools_from_directory=True)
8686

8787
# Create the initial version of the tool
8888
with open(test_tool_path, "w") as f:

0 commit comments

Comments
 (0)