{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-synthesize-a-gen-ai-tool-call-id-for-a-tool-invocation-that-arrives-without-one",
  "title": "In what scenarios must an instance refuse to synthesize a `gen_ai.tool.call.id` for a tool invocation that arrives without one",
  "date_of_record": "2026 November 16",
  "scope": "Applies to instrumentation that emits OpenTelemetry spans conforming to the GenAI semantic conventions (`gen_ai.*`), specifically the point where an agent framework executes a tool call whose upstream message lacks a stable tool-call identifier. Does not apply to non-GenAI spans, nor to frameworks that own the tool-call ID lifecycle end-to-end and never expose an ID-less invocation to the instrumentation layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-synthesize-a-gen-ai-tool-call-id-for-a-tool-invocation-that-arrives-without-one.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-synthesize-a-gen-ai-tool-call-id-for-a-tool-invocation-that-arrives-without-one.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-synthesize-a-gen-ai-tool-call-id-for-a-tool-invocation-that-arrives-without-one.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1626,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI conventions define `gen_ai.tool.call.id` as the identifier that lets a consumer correlate three distinct events: the assistant's *request* to call a tool (emitted on the `chat`/agent span as part of the model output), the *execution* of that tool (emitted on a `execute_tool` span), and the *result* fed back to the model on the next turn. The conven...",
    "what_was_observed": "In a multi-turn agent loop instrumented with a thin wrapper around a framework that permitted tool calls to be dispatched from a planner step rather than directly from a model response, the following was observed across roughly 40k spans over a two-day window: - Approximately 3.1% of `execute_tool` spans carried a `gen_ai.tool.call.id` that appeared on no other span in the trace. - All of these were synthesized by th...",
    "condition_of_validity": "Synthesizing a `gen_ai.tool.call.id` is only valid when the instrumentation can guarantee that the *same* ID will be attached to the corresponding request-side span and to the result message on the subsequent turn—i.e., when the instrumentation owns the full round-trip and can thread the ID through the framework. This holds for frameworks where the instrumen...",
    "decision_boundary": "The instrumentation must decide, per tool invocation, between two honest outcomes: - **Thread-through:** if the framework exposes a mutable tool-call record that is shared between the request span and the execution span, generate an ID once, write it into that record, and emit it on both spans. This is a *correlation repair*, and it is legitimate because the...",
    "operational_effect": "Refusing to synthesize preserves the integrity of ID-based joins, at the cost of some executions appearing uncorrelated. That cost is bounded and *visible*: uncorrelated executions cluster on known non-model paths (planner, retries) and can be counted directly. The alternative—synthesizing—converts a visible, bounded gap into an invisible, unbounded distorti..."
  },
  "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": "924123661669475762dc8837ef24b55b911eee1f7a1bd84cb552194d1b582108",
    "verified_classes": [
      "ToolCallIdInvariantError"
    ],
    "verified_functions": [
      "resolve_tool_call_id",
      "emit_execute_tool_span"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ToolCallIdInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "tool invocation has no gen_ai.tool.call.id and no shared record exists to thread a generated ID back to the request span"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
