[Bug]: GenAI spans omit conversation IDs for native propagated sessions
Affected area
Observability or exporters (gen_ai OpenTelemetry projection).
Current behavior
Native propagation correctly groups ATIF trajectories and OTel trace IDs, but GenAI spans can omit gen_ai.conversation.id. A Fabric/NOOA reproduction produced 18 spans (agent, method, model, tool), all sharing the requested trace ID, with no conversation attribute.
Steps to reproduce
- Configure a
gen_aiOTLP endpoint or JSON-lines file sink. - Enter a scope stack created from
PropagationContext(parent_uuid, root_uuid=session_uuid). - Run Agent, Function, LLM, and Tool scopes without adding conversation IDs to event metadata.
- Inspect exported spans: the trace ID follows the root, but
gen_ai.conversation.idis absent. ATIF still has the suppliedsession_id.
Expected behavior / proposed fix
Preserve explicit producer conversation IDs; otherwise use the event's native propagation root as gen_ai.conversation.id on every scope span, including Function/generic scopes. Do not fabricate roots or change full/OpenInference projections.
Please review this fallback and scope coverage before I open the PR, per CONTRIBUTING.md.
Environment
Relay 0.11.0, NOOA 0.0.10, Python 3.12, Linux ARM64. The same projection gap is present in current main (3c29c9d).
Impact and dependencies
Consumers requiring per-span conversation identity reject these traces. Related: NVIDIA/NeMo-Fabric#623, NVIDIA-NeMo/labs-OO-Agents#589, and #958. Fabric supports Relay 0.11, so adoption needs a compatible backport/release; a change on current 1.0 main alone is insufficient.
Implementation and review
A tested implementation branch is ready. Combined Fabric/NOOA qualification accepted all 45 spans with the public conversation-ID alias; the 0.11 build also needed existing upstream GenAI mapping support from #1613. Required Python/npm audits flag unchanged main lockfiles. Please confirm the proposed exporter behavior and compatible release/backport path before I open the PR.
@RyaliNvidia this seems like an appropriate fix, though extra validation should be done to ensure that the NeMo Relay CLI component for Codex and Claude code emits unique IDs per session. This doesn't have to be codified into tests, but a manual validation of this would be good.
Please target the upstream release/0.11 branch since this is strictly a bug
commandeering this in respect to timing constraints @RyaliNvidia , thank you for the issue!