NeMo-Relay icon indicating copy to clipboard operation
NeMo-Relay copied to clipboard

[Bug]: GenAI spans omit conversation IDs for native propagated sessions

Open RyaliNvidia opened this issue 3 weeks ago • 3 comments

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

  1. Configure a gen_ai OTLP endpoint or JSON-lines file sink.
  2. Enter a scope stack created from PropagationContext(parent_uuid, root_uuid=session_uuid).
  3. Run Agent, Function, LLM, and Tool scopes without adding conversation IDs to event metadata.
  4. Inspect exported spans: the trace ID follows the root, but gen_ai.conversation.id is absent. ATIF still has the supplied session_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 avatar Nov 13 '26 01:11 RyaliNvidia

@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.

willkill07 avatar Nov 14 '26 12:11 willkill07

Please target the upstream release/0.11 branch since this is strictly a bug

willkill07 avatar Nov 14 '26 12:11 willkill07

commandeering this in respect to timing constraints @RyaliNvidia , thank you for the issue!

greysonlalonde avatar Nov 23 '26 22:11 greysonlalonde