Describe the bug
The basic Agent Framework Responses hosted-agent sample does not emit the Agent Framework invoke_agent span or token usage attributes when deployed with the latest unpinned agent-framework-foundry-hosting dependency stack.
Sample:
https://github.com/microsoft-foundry/foundry-samples/tree/main/samples/python/hosted-agents/agent-framework/responses/01-basic
After pinning agent-framework-foundry-hosting==1.0.0b260730, the Agent Framework invoke_agent span and token attributes are emitted again.
Reproduction
- Deploy the sample to Microsoft Foundry using the Responses protocol and a
gpt-5 deployment.
- Because Foundry invokes the hosted endpoint with
store=true, enable resilient tasks before host startup:
from azure.ai.agentserver.core.tasks import set_resilient_tasks_enabled
set_resilient_tasks_enabled(True)
- Invoke the deployed agent normally.
- Inspect the correlated trace in Application Insights.
Failing dependency resolution
The unpinned sample resolved to:
azure-ai-agentserver-core==2.1.0b2
azure-ai-agentserver-responses==2.1.0b1
- latest available
agent-framework-foundry-hosting
Observed behavior:
- The request succeeds after resilient tasks are enabled.
- Only the platform
invoke_agent span is present.
- The Agent Framework
invoke_agent span is absent.
- No
gen_ai.usage.input_tokens or gen_ai.usage.output_tokens attributes are available.
- Runtime log contains:
WARNING agent_framework_foundry_hosting._responses: Content type 'usage' is not supported yet. This is usually safe to ignore.
Working dependency resolution
Change only the hosting requirement:
agent-framework-foundry-hosting==1.0.0b260730
This transitively resolves azure-ai-agentserver-responses==1.0.0b9 while retaining azure-ai-agentserver-core==2.1.0b2.
Observed behavior for the same sample and request:
- The Agent Framework
invoke_agent span is emitted.
gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, and gen_ai.usage.reasoning.output_tokens are populated.
- Example observed values: input
29, output 160, reasoning 128.
The Content type 'usage' is not supported yet warning is still logged in the working configuration, so the warning alone does not explain the missing span. This appears to be a compatibility/regression issue involving the newer hosting/AgentServer Responses stack.
Expected behavior
The current unpinned hosted-agent stack should emit the Agent Framework invoke_agent span with model token usage attributes for successful Responses invocations, matching the behavior of the older compatible stack.
Additional context
Without set_resilient_tasks_enabled(True), store=true requests fail earlier with:
Resilient task subsystem missing in hosted environment
That execution issue is resolved by enabling resilient tasks; this report concerns the remaining missing Agent Framework span and token telemetry after successful execution.
Describe the bug
The basic Agent Framework Responses hosted-agent sample does not emit the Agent Framework
invoke_agentspan or token usage attributes when deployed with the latest unpinnedagent-framework-foundry-hostingdependency stack.Sample:
https://github.com/microsoft-foundry/foundry-samples/tree/main/samples/python/hosted-agents/agent-framework/responses/01-basic
After pinning
agent-framework-foundry-hosting==1.0.0b260730, the Agent Frameworkinvoke_agentspan and token attributes are emitted again.Reproduction
gpt-5deployment.store=true, enable resilient tasks before host startup:Failing dependency resolution
The unpinned sample resolved to:
azure-ai-agentserver-core==2.1.0b2azure-ai-agentserver-responses==2.1.0b1agent-framework-foundry-hostingObserved behavior:
invoke_agentspan is present.invoke_agentspan is absent.gen_ai.usage.input_tokensorgen_ai.usage.output_tokensattributes are available.Working dependency resolution
Change only the hosting requirement:
This transitively resolves
azure-ai-agentserver-responses==1.0.0b9while retainingazure-ai-agentserver-core==2.1.0b2.Observed behavior for the same sample and request:
invoke_agentspan is emitted.gen_ai.usage.input_tokens,gen_ai.usage.output_tokens, andgen_ai.usage.reasoning.output_tokensare populated.29, output160, reasoning128.The
Content type 'usage' is not supported yetwarning is still logged in the working configuration, so the warning alone does not explain the missing span. This appears to be a compatibility/regression issue involving the newer hosting/AgentServer Responses stack.Expected behavior
The current unpinned hosted-agent stack should emit the Agent Framework
invoke_agentspan with model token usage attributes for successful Responses invocations, matching the behavior of the older compatible stack.Additional context
Without
set_resilient_tasks_enabled(True),store=truerequests fail earlier with:That execution issue is resolved by enabling resilient tasks; this report concerns the remaining missing Agent Framework span and token telemetry after successful execution.