{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-emits-genai-tool-call-spans-without-a-stable-gen-ai-tool-call-id-and-the-collector-s-span-link-reconciliation-silently-o",
  "title": "What happens when an instance emits GenAI tool-call spans without a stable `gen_ai.tool.call.id` and the collector's span-link reconciliation silently orphans the parent agent turn",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that emit OpenTelemetry GenAI semantic-convention spans (`gen_ai.*` attributes) for multi-step tool-calling loops and rely on span links or parent-child relationships to reconstruct an agent turn across a collector. Does not apply to single-shot LLM calls with no tool invocation, nor to systems that persist their own trace-side state independent of OTel export.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-genai-tool-call-spans-without-a-stable-gen-ai-tool-call-id-and-the-collector-s-span-link-reconciliation-silently-o.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-genai-tool-call-spans-without-a-stable-gen-ai-tool-call-id-and-the-collector-s-span-link-reconciliation-silently-o.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-emits-genai-tool-call-spans-without-a-stable-gen-ai-tool-call-id-and-the-collector-s-span-link-reconciliation-silently-o.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1811,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat `gen_ai.operation.name` (`chat`, `execute_tool`, `invoke_agent`) as the discriminator and `gen_ai.tool.call.id` as the correlation key that lets a consumer stitch an `execute_tool` span back to the `chat` span that requested it. The failure mode here is not \"missing telemetry.\" It is **telemetry that is present, well-form...",
    "what_was_observed": "An agent loop executing a three-step plan: `chat` → `execute_tool(search)` → `chat` → `execute_tool(fetch)` → `chat`. Instrumentation emitted one `invoke_agent` root span, three `chat` child spans, and two `execute_tool` spans. On the happy path the tool spans carried `gen_ai.tool.call.id` copied from the provider's `tool_calls[i].id` (e.g. `call_a1b2`), and the collector joined each `execute_tool` to the preceding `...",
    "condition_of_validity": "The reconciliation invariant only holds when, for every `execute_tool` span, there exists exactly one `chat` (or `invoke_agent`) span in the same trace whose recorded tool-call set contains the span's `gen_ai.tool.call.id`, **and** that id is byte-identical across every retry of the same logical call. The convention supports this but does not enforce it: `ge...",
    "decision_boundary": "The decision point is at the retry wrapper and at the collector's join pass, and they must agree on a single policy. Two coherent policies exist; mixing them produces the orphan. - **Id-stable retry (preferred):** the retry clones the original `ToolCall` including `id`; both attempt-spans carry `call_a1b2`, distinguished only by `status`/`error.type` and a `...",
    "operational_effect": "The trace remains green in every dashboard that counts spans, error rates, and latency. The corruption is confined to the *edge set*, which almost nothing monitors. Consequences compound: - **Replay divergence:** re-running the agent from the trace yields different tool outputs than the recorded turn, because the recorded turn's provenance edge is missing; t..."
  },
  "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": "f2120c2d8a21cfc1fdd86b5d3dad4ef1d7dbfa08ab8b0a8156bbad1a023c4855",
    "verified_classes": [
      "OrphanedToolCallError",
      "ToolSpan",
      "ChatSpan"
    ],
    "verified_functions": [
      "reconcile_turn",
      "emit_turn"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OrphanedToolCallError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
