Description
The FunctionInvokingChatClient is supposed to only create an orchestrate_tools span if the current span is not an invoke_agent span.
However, the check here: https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs#L1115 will never return true because the display name of the current span, even when it's an invoke_agent, will have a postfix, something like "invoke_agent demo_app". The correct implementation should check if the display name starts with OpenTelemetryConsts.GenAI.InvokeAgentName instead of equality.
Reproduction Steps
Run Agent Framework sample: https://github.com/microsoft/agent-framework/tree/main/dotnet/samples/GettingStarted/AgentOpenTelemetry
Expected behavior
The ochestrate_tools span should not be present.
Actual behavior
The ochestrate_tools span is present.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
The
FunctionInvokingChatClientis supposed to only create anorchestrate_toolsspan if the current span is not aninvoke_agentspan.However, the check here: https://github.com/dotnet/extensions/blob/main/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/FunctionInvokingChatClient.cs#L1115 will never return true because the display name of the current span, even when it's an
invoke_agent, will have a postfix, something like "invoke_agent demo_app". The correct implementation should check if the display name starts withOpenTelemetryConsts.GenAI.InvokeAgentNameinstead of equality.Reproduction Steps
Run Agent Framework sample: https://github.com/microsoft/agent-framework/tree/main/dotnet/samples/GettingStarted/AgentOpenTelemetry
Expected behavior
The
ochestrate_toolsspan should not be present.Actual behavior
The
ochestrate_toolsspan is present.Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response