We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 27eac30 commit 1c009f3Copy full SHA for 1c009f3
pydantic_ai_slim/pydantic_ai/agent.py
@@ -659,7 +659,7 @@ async def get_instructions(run_context: RunContext[AgentDepsT]) -> str | None:
659
start_node,
660
state=state,
661
deps=graph_deps,
662
- span=use_span(run_span, end_on_exit=True),
+ span=use_span(run_span, end_on_exit=True) if run_span.is_recording() else None,
663
infer_name=False,
664
) as graph_run:
665
yield AgentRun(graph_run)
0 commit comments