{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-gen-ai-tool-call-id-as-a-span-local-correlation-key-rather-than-a-globally-unique-identifier-in-opentelem",
  "title": "Under what conditions must an instance treat `gen_ai.tool.call.id` as a span-local correlation key rather than a globally unique identifier in OpenTelemetry GenAI agent telemetry",
  "date_of_record": "2026 November 13",
  "scope": "Applies to agent frameworks and instrumentations emitting spans under the OpenTelemetry GenAI semantic conventions (`gen_ai.operation.name = execute_tool`, `gen_ai.agent.*`, `gen_ai.tool.*`) where tool calls may be retried, parallelized, or re-emitted across process boundaries. Does not apply to single-shot synchronous tool invocations with a single emitting process and no retry layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-gen-ai-tool-call-id-as-a-span-local-correlation-key-rather-than-a-globally-unique-identifier-in-opentelem.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-gen-ai-tool-call-id-as-a-span-local-correlation-key-rather-than-a-globally-unique-identifier-in-opentelem.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-gen-ai-tool-call-id-as-a-span-local-correlation-key-rather-than-a-globally-unique-identifier-in-opentelem.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1327,
    "python_slice_tokens": 193,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define `gen_ai.tool.call.id` as an identifier correlating a tool invocation span with the request/response pair it represents. The conventions do **not** assert that this value is globally unique across the trace, the service, or the process lifetime. Implementations commonly populate it from the model provider's tool-call ID (...",
    "what_was_observed": "In a multi-agent pipeline (planner → N parallel workers → tool executor), the tool executor emitted `execute_tool` spans with `gen_ai.tool.call.id` sourced from the upstream model's tool-call block. Under a retry wrapper (3 attempts, exponential backoff), the retry re-invoked the same logical call and re-emitted a span carrying the *same* `gen_ai.tool.call.id` but a *new* `trace_id`/`span_id`. The observability backe...",
    "condition_of_validity": "`gen_ai.tool.call.id` may be treated as a stable correlation key *only* when all of the following hold: - The ID is generated **at tool-call creation time**, not at span-emission time, and is threaded through every retry/replay of that call. - The emitting instrumentation sets `gen_ai.tool.call.id` from a source that is stable across the call's full lifetime...",
    "decision_boundary": "The decision to promote `gen_ai.tool.call.id` to a join key is a **hard boundary**, not a heuristic: - **Promote** (use as join key) if and only if the ID is creation-time-stable *and* scoped by at least one of `trace_id`, `gen_ai.agent.id`, or `gen_ai.conversation.id` in every join. - **Do not promote** if the ID is emission-time-generated, or if the provid...",
    "operational_effect": "Treating the ID as globally unique produces three observable symptoms, in order of detection difficulty: 1. **Inflated call counts** under retry/replay — success-rate and latency panels drift upward in denominator without any corresponding increase in real work. 2. **Broken parent-child linkage** after checkpoint restore — orphaned `execute_tool` spans whose..."
  },
  "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": "333ab277835bbe25489b01c5771c7a11e497eb63d963dd012a217e07e33c760d",
    "verified_classes": [
      "ToolCallIdInvariantError",
      "ToolCallSpan"
    ],
    "verified_functions": [
      "assert_join_safe",
      "composite_key"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ToolCallIdInvariantError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
