{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-genai-tool-call-span-has-become-an-orphaned-causal-island-under-opentelemetry-semantic-conventions",
  "title": "How does an instance detect that a GenAI tool-call span has become an orphaned causal island under OpenTelemetry semantic conventions",
  "date_of_record": "2026 November 25",
  "scope": "Applies to LLM agent runtimes that emit OpenTelemetry spans using the GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.agent.id`, `gen_ai.usage.*`) and correlate tool-call spans to agent spans via context propagation. Does not apply to single-shot inference tracing without tool dispatch, nor to trace backends that reconstruct parentage from payload content rather than `parent_span_id`.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-genai-tool-call-span-has-become-an-orphaned-causal-island-under-opentelemetry-semantic-conventions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-genai-tool-call-span-has-become-an-orphaned-causal-island-under-opentelemetry-semantic-conventions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-genai-tool-call-span-has-become-an-orphaned-causal-island-under-opentelemetry-semantic-conventions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1525,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between a tool-call span that is *orphaned because its parent agent span ended* and a tool-call span that is *orphaned because the parent context was never propagated across an asynchronous dispatch boundary*. Both produce the same observable symptom in a trace viewer—a `gen_ai.tool.name` span whose `parent_span_id` points to ...",
    "what_was_observed": "During a replay audit of a multi-step agent that dispatched tool calls through a bounded worker pool, roughly 4% of tool spans per 1,000-call run appeared as single-span traces. Each carried a correct `gen_ai.tool.name`, a correct `gen_ai.agent.id`, and a `gen_ai.operation.name = \"execute_tool\"`, but a `trace_id` that matched no agent span. The agent span itself recorded the tool call in its event list, so the logica...",
    "condition_of_validity": "This detection procedure is valid only when all of the following hold: 1. The runtime propagates context explicitly across every asynchronous boundary (executor submit, `asyncio.to_thread`, queue publish, subprocess spawn) via `contextvars.copy_context().run(...)` or an equivalent manual carrier. If the runtime never propagates context, *every* tool span is ...",
    "decision_boundary": "The boundary between \"acceptable detached trace\" and \"propagation defect\" is decided by one test: **does the tool span carry a `SpanLink` back to the invoking agent span, or a `trace_id` equal to the invoker's?** - If `trace_id` matches the invoker: parentage may be broken (parent closed) but causality is intact. Re-parent to the session/turn span; no alarm....",
    "operational_effect": "Left undetected, severed islands corrupt three downstream consumers. First, latency attribution: the agent's wall-clock time includes tool execution, but the tool span's duration is invisible on the agent's trace, so p99 agent latency looks unexplained and tool latency is undercounted. Second, error compounding analysis: a failed tool call in an island canno..."
  },
  "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": "38c4ba96e4341a08204d989da6cd73ddd97658d1650d6243238558d944d0efc0",
    "verified_classes": [
      "OrphanedToolSpanError",
      "SpanHandle"
    ],
    "verified_functions": [
      "start_tool_span",
      "_start"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "contextvars",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
