{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-tool-call-span-attribute-collapse-under-opentelemetry-genai-semantic-conventions-when-a-single-logical-tool-invocatio",
  "title": "What structural signals indicate tool-call span attribute collapse under OpenTelemetry GenAI semantic conventions when a single logical tool invocation is retried across agent turns",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents emitting OpenTelemetry spans conforming to the GenAI semantic conventions (`gen_ai.*` attributes) where a logical tool call spans multiple agent reasoning turns due to retry, partial failure, or deferred execution. Does not apply to single-shot tool invocations completed within one span, nor to non-GenAI telemetry.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-span-attribute-collapse-under-opentelemetry-genai-semantic-conventions-when-a-single-logical-tool-invocatio.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-span-attribute-collapse-under-opentelemetry-genai-semantic-conventions-when-a-single-logical-tool-invocatio.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-tool-call-span-attribute-collapse-under-opentelemetry-genai-semantic-conventions-when-a-single-logical-tool-invocatio.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1610,
    "python_slice_tokens": 228,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct accounting units that the GenAI semantic conventions conflate unless the emitter is disciplined: the **logical tool invocation** (one intent, one expected result, uniquely identified by the model's tool-call ID) and the **transport attempt** (one actual execution against a downstream system). The convention's `gen_ai.tool.call.id` attr...",
    "what_was_observed": "Consider an agent that decides to call `search_docs(query=\"refund policy\")`. The model emits a tool call with ID `call_abc123`. The executor times out at 30s. The orchestrator feeds the timeout back as a tool result. The model, on the next turn, re-emits the *same* semantic intent but the harness mints a new call ID `call_def456` because it re-reads the model's structured output. Two spans are exported: Downstream, a...",
    "condition_of_validity": "The additive token invariant (`sum(input_tokens) over spans with same call ID = logical invocation cost`) is valid **only if** each attempt span carries a distinct `gen_ai.tool.call.id` *and* a shared parent identifier that groups them. The GenAI conventions provide neither a mandated grouping attribute nor a mandated uniqueness constraint. The emitter must ...",
    "decision_boundary": "The decision boundary is whether the orchestrator treats the model's tool-call ID as **authoritative identity** or as **advisory hint**. - If authoritative: the orchestrator MUST preserve it verbatim across retries and MUST attach an attempt discriminator (`agent.tool.attempt=1,2,...`). Retries are then recoverable by grouping on the preserved ID, and token ...",
    "operational_effect": "When the invariant is violated, three operational signals degrade in a correlated pattern that is itself diagnostic: 1. **Cost-per-tool-name is inflated** relative to the provider's own billing, because retries double-count input tokens (the model re-sends context on each attempt). 2. **Retry-rate is under-reported to zero** for regeneration-path retries and..."
  },
  "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": "261ae2ed533a42d98b5263138cff431e95662d436bbb150c0798ccee79fdc238",
    "verified_classes": [
      "ToolCallAccountingCollapse"
    ],
    "verified_functions": [
      "validate_tool_call_spans"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ToolCallAccountingCollapse"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
