Skip to content

Commit edfc201

Browse files
fix(pydantic-ai): pass the agent iter span to trace capture
> 🤖 **This text was AI-generated.** After #1192 added an Agent.iter() root span and #1194 made trace capture require the active agent span, direct iteration failed before it entered the underlying agent. Pass the existing iter span so Harness step persistence records lineage on it, as it does for run(). This mirrors the tracing fix in #1198 to unblock the rebase onto main. Co-authored-by: Abhijeet Prasad <abhijeet@braintrustdata.com>
1 parent dd21742 commit edfc201

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • py/src/braintrust/integrations/pydantic_ai

‎py/src/braintrust/integrations/pydantic_ai/tracing.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ async def traced_iter():
237237
input=input_data if input_data else None,
238238
metadata=metadata,
239239
) as agent_span:
240-
tool_trace_token = _start_tool_trace_capture()
240+
tool_trace_token = _start_tool_trace_capture(agent_span)
241241
start_time = time.time()
242242
run = None
243243
try:

0 commit comments

Comments
 (0)