Skip to content

Commit 1db3a25

Browse files
committed
fix: tool call arg resolution
1 parent 932993d commit 1db3a25

File tree

1 file changed

+4
-3
lines changed
  • sentry_sdk/integrations/pydantic_ai/patches

1 file changed

+4
-3
lines changed

sentry_sdk/integrations/pydantic_ai/patches/tools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ async def wrapped_call_tool(self, call, allow_partial, wrap_validation_errors):
5757
)
5858
agent = agent_data.get("_agent")
5959

60-
# Get args for span (before validation)
61-
# call.args can be a string (JSON) or dict
62-
args_dict = call.args if isinstance(call.args, dict) else {}
60+
try:
61+
args_dict = call.args_as_dict()
62+
except Exception:
63+
args_dict = call.args if isinstance(call.args, dict) else {}
6364

6465
with execute_tool_span(name, args_dict, agent, tool_type=tool_type) as span:
6566
try:

0 commit comments

Comments
 (0)