Skip to content

Python: Python hosting: preserve OTel parent span for deferred streaming #6708

Description

@eavanvalkenburg

Motivation

Hosted-agent streaming can defer target execution until after the route handler returns a streaming response. In that deferred phase, inbound request span context may no longer be current, causing child spans from agent/chat/tool execution to lose strict parent-child linkage.

Scope

  • Apply a host-wide fix in agent-framework-hosting stream adapters (not Responses-only).
  • Preserve existing stream lifecycle behavior (close semantics, hook ordering).
  • Add regressions at host level and Responses integration level to lock parent-span propagation for deferred streaming.

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: Python

Type

No fields configured for Bug.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions