Description
When a CodeAct agent invokes a host tool from inside the execute_code tool, the OpenTelemetry span for that invoked host tool should be parented underneath the execute_code tool span.
Right now, the tool span appears as a separate sibling / incorrectly-parented span in the trace, which makes the CodeAct execution flow harder to understand in observability tools such as the Aspire dashboard.
Expected behavior
For a CodeAct run like:
- Agent calls
execute_code.
- Code inside the sandbox calls a host tool via
call_tool(...).
- The host tool executes.
The trace hierarchy should look like:
agent run
└── execute_code tool
└── host tool invoked by CodeAct
Actual behavior
The host tool invoked by CodeAct is not parented under the execute_code tool span, so the trace does not accurately represent the nested execution flow.
Why this matters
Correct span parenting would make CodeAct traces easier to inspect, especially when debugging sandbox execution and host-tool calls in OTEL backends.
Description
When a CodeAct agent invokes a host tool from inside the
execute_codetool, the OpenTelemetry span for that invoked host tool should be parented underneath theexecute_codetool span.Right now, the tool span appears as a separate sibling / incorrectly-parented span in the trace, which makes the CodeAct execution flow harder to understand in observability tools such as the Aspire dashboard.
Expected behavior
For a CodeAct run like:
execute_code.call_tool(...).The trace hierarchy should look like:
Actual behavior
The host tool invoked by CodeAct is not parented under the
execute_codetool span, so the trace does not accurately represent the nested execution flow.Why this matters
Correct span parenting would make CodeAct traces easier to inspect, especially when debugging sandbox execution and host-tool calls in OTEL backends.