Skip to content

Commit 616ec5a

Browse files
committed
fix(tools): resolve mutation errors on FieldInfo with deepcopy
1 parent 9a4b2e6 commit 616ec5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/strands/tools/decorator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def my_tool(param1: str, param2: int = 42) -> dict:
4444
import functools
4545
import inspect
4646
import logging
47-
from copy import copy
47+
from copy import deepcopy
4848
from typing import (
4949
Annotated,
5050
Any,
@@ -153,7 +153,7 @@ def _extract_annotated_metadata(
153153

154154
# Create Final FieldInfo with proper default handling
155155
if field_info:
156-
final_field = copy(field_info)
156+
final_field = deepcopy(field_info)
157157
final_field.description = final_description
158158

159159
# Function signature default takes priority

0 commit comments

Comments
 (0)