{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-genai-tool-call-span-has-silently-lost-its-parent-link-across-an-async-agent-handoff",
  "title": "What structural signals indicate a GenAI tool-call span has silently lost its parent link across an async agent handoff",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes that emit OpenTelemetry `gen_ai.*` spans across asynchronous tool-call boundaries (task queues, subprocess tool sandboxes, remote MCP servers) where the child span is created after the parent's context object has been serialized rather than inherited in-process. Does not apply to strictly synchronous in-process tool dispatch, where the OTel context is naturally propagated on the call stack.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-genai-tool-call-span-has-silently-lost-its-parent-link-across-an-async-agent-handoff.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-genai-tool-call-span-has-silently-lost-its-parent-link-across-an-async-agent-handoff.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-genai-tool-call-span-has-silently-lost-its-parent-link-across-an-async-agent-handoff.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1722,
    "python_slice_tokens": 236,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common assumption is that a tool-call span missing a parent is a *tracing configuration* problem — a missing propagator, an unregistered tracer, a dropped `traceparent` header. Those failures are loud: the span appears as a new trace root and the exporter's `parent_span_id` is empty, which any backend flags as an orphan. The non-obvious failure is differ...",
    "what_was_observed": "A planner agent executes a turn (`gen_ai.operation.name = \"chat\"`, span `A`), decides to call a tool, and enqueues the tool task with a serialized `SpanContext` captured at enqueue time. The worker that consumes the task opens the tool span (`gen_ai.operation.name = \"execute_tool\"`, span `B`) as a child of `A`. So far correct. The tool times out at the worker's deadline. The agent's orchestration layer, unaware of th...",
    "condition_of_validity": "The stale-parent condition is only diagnosable — and only *harmful to reasoning* — under a specific conjunction: 1. The parent context is serialized at enqueue time rather than inherited by reference at execution time. 2. At least one retry or re-dispatch occurs after the originating turn has closed. 3. The retry's deduplication or caching key does not inclu...",
    "decision_boundary": "The guardrail is not \"propagate context correctly\" — the context *was* propagated. The guardrail is a **parent-freshness check at span emission**: before a tool-call span is exported, verify that the referenced parent span is either still open or closed within a bounded window of the child's start. If the parent closed more than the orchestration's turn-late...",
    "operational_effect": "Downstream, a trace consumer (an agent auditor, a replay verifier, a debugging human) reading this trace concludes that the retried tool call was caused by turn `A`. It will attribute the tool's second failure to a reasoning path that never issued it. Error-compounding analyses that walk parent→child to compute \"which reasoning step introduced this bad tool ..."
  },
  "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": "f2eccc1569ac2c4ad56a52e5b73dfbb0824ea3eb369fc7f81b1d5768ce83dbd3",
    "verified_classes": [
      "StaleParentSpanError"
    ],
    "verified_functions": [
      "validate_tool_span_parentage"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "StaleParentSpanError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
