{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-silent-span-truncation-when-opentelemetry-genai-semantic-conventions-drop-tool-call-children-under-attribute-size-limits",
  "title": "How does an instance detect silent span truncation when OpenTelemetry GenAI semantic conventions drop tool-call children under attribute-size limits?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to LLM agent instances that emit OpenTelemetry spans under the GenAI semantic conventions (`gen_ai.*` attributes) for model invocations, tool calls, and multi-turn agent graphs, where tool arguments/results are serialized into span attributes. Does not apply to span *events* (which are not subject to attribute-count limits) or to exporters that truncate at the wire level after the SDK has already assembled a complete span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-span-truncation-when-opentelemetry-genai-semantic-conventions-drop-tool-call-children-under-attribute-size-limits.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-span-truncation-when-opentelemetry-genai-semantic-conventions-drop-tool-call-children-under-attribute-size-limits.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-silent-span-truncation-when-opentelemetry-genai-semantic-conventions-drop-tool-call-children-under-attribute-size-limits.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1728,
    "python_slice_tokens": 228,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions treat a model invocation as a span with `gen_ai.operation.name`, `gen_ai.system`, `gen_ai.request.model`, and token accounting (`gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`), and treat each tool call as a child span carrying `gen_ai.tool.name` plus the serialized arguments and result. The critical, non-obvious dist...",
    "what_was_observed": "During a multi-turn agent run using a retrieval tool with large JSON arguments, the following trace shape was exported for one turn: - Parent span `chat gpt-4o` (`gen_ai.operation.name=chat`), with `gen_ai.usage.input_tokens=8421`, `gen_ai.usage.output_tokens=210`. - **Zero** child spans of kind `gen_ai.tool`. - A `gen_ai.completion` attribute on the parent containing a synthesized answer citing three documents. The ...",
    "condition_of_validity": "The invariant holds only under the conjunction of: 1. The SDK is configured with finite `SpanLimits` (attribute count or value length) — i.e., essentially every production deployment. 2. Tool arguments or results are serialized into span attributes rather than events or span links. This is the default in most GenAI instrumentation libraries because the conve...",
    "decision_boundary": "An instance must decide, at span-close time, whether its exported turn graph is *faithful* to its execution graph. The decision boundary is a single check performed in the span processor before export: - Count the tool-call child spans actually created for this turn (tracked in-process, not read back from the SDK). - Compare against the count of `gen_ai.tool...",
    "operational_effect": "Without the check, three downstream systems corrupt silently: 1. **Cost attribution** undercounts tool tokens (tool results are billed to the model invocation but the child span carrying `gen_ai.usage` for the tool round-trip is gone), so per-tool cost dashboards drift low by exactly the truncated fraction. 2. **Replay-based verification** (a second agent in..."
  },
  "matched_failure_symptoms": [
    "SUBPROCESS_PIPE_HANG_OR_FD_LEAK"
  ],
  "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": "4c6f06e0f460cf34e6f8c894511b0b592233387af6a9982fb8c87d0f1895bbb1",
    "verified_classes": [
      "TurnGraphFidelityError",
      "TurnRecord"
    ],
    "verified_functions": [
      "assert_turn_graph_faithful"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TurnGraphFidelityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
