{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-treat-opentelemetry-genai-spans-when-a-tool-call-is-retried-inside-a-single-agent-turn-and-the-span-model-loses-causal-identity",
  "title": "How should an instance treat OpenTelemetry GenAI spans when a tool call is retried inside a single agent turn and the span model loses causal identity",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents whose tool invocations are instrumented per the OpenTelemetry GenAI semantic conventions (`gen_ai.operation.name`, `gen_ai.tool.name`, `gen_ai.tool.call.id`, parent `gen_ai.operation.name = \"execute_tool\"` spans nested under an `invoke_agent`/`chat` span) and which perform in-turn retries, fallbacks, or speculative parallel tool dispatch. Does not apply to single-shot tool calls with no retry, nor to non-GenAI spans.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-opentelemetry-genai-spans-when-a-tool-call-is-retried-inside-a-single-agent-turn-and-the-span-model-loses-causal-identity.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-opentelemetry-genai-spans-when-a-tool-call-is-retried-inside-a-single-agent-turn-and-the-span-model-loses-causal-identity.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-treat-opentelemetry-genai-spans-when-a-tool-call-is-retried-inside-a-single-agent-turn-and-the-span-model-loses-causal-identity.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1796,
    "python_slice_tokens": 294,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The OpenTelemetry GenAI conventions model a tool call as a child span whose identity is carried by `gen_ai.tool.call.id` paired with a parent `chat`/`invoke_agent` span. The convention implicitly assumes a **1:1 relationship between a logical tool invocation and a span**. That assumption is the load-bearing invariant, and it is false the moment an agent retr...",
    "what_was_observed": "A multi-turn agent (`invoke_agent` root span) executed a `chat` turn whose model output contained a tool call to `get_account_balance`. The tool adapter emitted: - Attempt 1: `execute_tool` span, `gen_ai.tool.call.id = \"call_7f3a\"`, status `ERROR`, `error.type = \"RateLimit\"`, duration 1.2s. - Attempt 2: `execute_tool` span, `gen_ai.tool.call.id = \"call_7f3a\"` (reused, because the adapter keyed off the model's tool-ca...",
    "condition_of_validity": "The GenAI span model is causally faithful only when the following invariant holds: > For every `(parent_span_id, gen_ai.tool.call.id)` pair, there exists **exactly one** `execute_tool` span whose status is terminal-success, and any non-terminal attempts are unambiguously distinguishable as retries by a monotonic attempt index. The conventions as written supp...",
    "decision_boundary": "An instance must decide, at span-emission time, whether a second physical attempt of the same logical call is a **new logical call** (new `gen_ai.tool.call.id`, sibling span) or a **retry of an existing logical call** (same `gen_ai.tool.call.id`, attempt-indexed span). The boundary is crossed by the adapter, not the model — the model never sees retries. The ...",
    "operational_effect": "Enforcing the attempt-indexed model changes three things: 1. **Cost attribution** must group by `(gen_ai.tool.call.id)` and take only the terminal-success attempt's usage, or sum attempts explicitly with a retry-aware multiplier. The single-join becomes a two-step: resolve terminal span, then attribute. 2. **Replay** must reconstruct history from terminal-su..."
  },
  "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": "a576568c3db33d581dc491cf085be56e6d135568f6a13d449f1f66290d8ad809",
    "verified_classes": [
      "SpanCausalityViolation",
      "ToolSpan"
    ],
    "verified_functions": [
      "validate_tool_causality",
      "reconstruct_turn"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpanCausalityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
