{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abandon-a-parent-span-cross-process-trace-context-propagation-loss-in-opentelemetry-genai-agent-spans-during-tool-call-fan-out",
  "title": "When must an instance abandon a parent span: cross-process trace-context propagation loss in OpenTelemetry GenAI agent spans during tool-call fan-out",
  "date_of_record": "2026 November 25",
  "scope": "Applies to multi-process or multi-runtime agent architectures where an orchestrator LLM emits tool calls that execute in separate worker processes (sandboxes, sub-agents, MCP servers) and where each worker emits `gen_ai.*` spans that must attach to the orchestrator's trace. Does not apply to single-process agents where all spans share one `TracerProvider` and one in-memory context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-a-parent-span-cross-process-trace-context-propagation-loss-in-opentelemetry-genai-agent-spans-during-tool-call-fan-out.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-a-parent-span-cross-process-trace-context-propagation-loss-in-opentelemetry-genai-agent-spans-during-tool-call-fan-out.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abandon-a-parent-span-cross-process-trace-context-propagation-loss-in-opentelemetry-genai-agent-spans-during-tool-call-fan-out.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1892,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A trace-context propagation failure is not the same as a missing span. When a worker process loses the W3C `traceparent` (or the `tracestate` carrying the `gen_ai.conversation.id` and vendor baggage), it still emits a *syntactically valid* span — with a fresh `trace_id`, a fresh `span_id`, and a `parent_span_id` pointing at nothing the collector has ever see...",
    "what_was_observed": "An orchestrator agent (`gen_ai.operation.name = \"invoke_agent\"`, `gen_ai.system = \"openai\"`, `gen_ai.request.model = \"gpt-4o\"`) ran a plan-execute loop. Each step dispatched a tool call to a subprocess worker via a local queue. The orchestrator serialized the tool arguments as JSON and injected the current span context into the message envelope as a `traceparent` header string. The propagation worked for the first N ...",
    "condition_of_validity": "The invariant that must hold for cost telemetry to be trustworthy: > For every span S with `gen_ai.operation.name` in {`execute_tool`, `invoke_agent`, `chat`}, if S is causally descended from a root agent span R, then `S.trace_id == R.trace_id`, and the sum of `gen_ai.usage.*` over all descendants equals the root's reported usage within the model's accountin...",
    "decision_boundary": "An instance must decide, per dispatch, between two behaviors when it cannot attach a valid `traceparent` to a tool call: 1. **Fail closed** — refuse to dispatch, surface a `PropagationLossError`, and let the orchestrator checkpoint and retry with a freshly minted context. Correct for any call that mutates external state or whose cost must be attributable. 2....",
    "operational_effect": "Implementing fail-closed dispatch on missing trace context converts a silent 25% cost leak into a loud, retryable error at step 7 — the orchestrator's existing checkpoint/resume machinery handles it, and the retried call carries a valid context because it is now dispatched from live state. The cost of the guardrail is one extra retry on the rare reconstructi..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "7579e684db5449938e02ec54ad022ace6dbb097c8f72e1149eea2f6e24b4d64c",
    "verified_classes": [
      "PropagationLossError",
      "DispatchEnvelope"
    ],
    "verified_functions": [
      "build_dispatch_envelope",
      "reconcile_trace_cost"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PropagationLossError"
    ],
    "sample_fail_closed_invariants": [
      "root span reports zero usage; cannot reconcile"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
