{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-propagate-trace-context-when-an-agent-span-suspends-for-an-asynchronous-tool-call-and-why-the-naive-handoff-silently-orphans-ch",
  "title": "Where must an instance propagate trace context when an agent span suspends for an asynchronous tool call, and why the naive handoff silently orphans child spans",
  "date_of_record": "2026 November 17",
  "scope": "Applies to multi-agent and tool-using LLM systems that emit OpenTelemetry-compatible spans across at least one asynchronous (deferred, queued, or callback-driven) tool invocation. Does not apply to fully synchronous in-process tool calls where the parent span's execution context remains live for the entire child lifetime.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-propagate-trace-context-when-an-agent-span-suspends-for-an-asynchronous-tool-call-and-why-the-naive-handoff-silently-orphans-ch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-propagate-trace-context-when-an-agent-span-suspends-for-an-asynchronous-tool-call-and-why-the-naive-handoff-silently-orphans-ch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-propagate-trace-context-when-an-agent-span-suspends-for-an-asynchronous-tool-call-and-why-the-naive-handoff-silently-orphans-ch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1664,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary in question is not \"does the trace ID survive serialization.\" It is: **at which instant does the *active span* (the unit of parentage) transition from the suspended agent span to the resumed child span, and who owns that transition?** A trace context (`trace_id`, `span_id`, `trace_flags`, `trace_state`) is a passive value. Propagation is trivial...",
    "what_was_observed": "In a three-level agent topology (orchestrator → planner agent → tool-calling agent → async retrieval tool), the orchestrator and planner spans appeared correctly nested. The tool-execution span and everything beneath it appeared as a **separate root trace** with a different `trace_id`, or — when a W3C `traceparent` was threaded manually — as a child of the planner span but with a **missing intermediate tool-call span...",
    "condition_of_validity": "The invariant holds — and the failure is *in scope* — only when all of the following are true: - The tool call is genuinely asynchronous: the calling agent's coroutine/thread releases control and a different execution context (worker, event-loop callback, queue consumer) runs the tool. - Child spans are created *after* the await boundary, not before it. - Th...",
    "decision_boundary": "The decision is not \"propagate context or not.\" It is **where to re-establish the active parent on resume**. - If the tool worker runs in a context where the suspended agent span *can* be made active again cheaply (same process, context variable restorable from the carrier), re-activate the parent span before creating the tool-execution span, and do **not** ...",
    "operational_effect": "When the invariant is honored (parent kept open across suspension, or link semantics used), traces render as a single tree and latency attribution across the async boundary is correct: the tool-execution span's duration is attributable to the agent span that awaited it. When it is violated, three operational consequences follow: (a) trace-based latency analy..."
  },
  "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": "5c6abe6240b26e8e09c3e9c9e647a9f708c15d0f861e34975732b8b5f76edece",
    "verified_classes": [
      "TraceContextOrphanError",
      "SpanHandle"
    ],
    "verified_functions": [
      "carrier_from_span",
      "create_child_span",
      "_new_span_id",
      "suspend_agent_span"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TraceContextOrphanError"
    ],
    "sample_fail_closed_invariants": [
      "suspend on an already-closed span"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "secrets",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
