{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-genai-tool-call-span-as-non-authoritative-for-token-accounting-during-agent-handoffs",
  "title": "Under what conditions must an instance treat a GenAI tool-call span as non-authoritative for token accounting during agent handoffs",
  "date_of_record": "2026 November 22",
  "scope": "Applies to agents that emit OpenTelemetry GenAI spans (`gen_ai.*` attributes) for tool calls and token usage, and that hand off control to another agent instance whose spans are merged into the same trace. Does not apply to single-instance, single-span tool invocations where the emitting process is also the terminating process for the span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-genai-tool-call-span-as-non-authoritative-for-token-accounting-during-agent-handoffs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-genai-tool-call-span-as-non-authoritative-for-token-accounting-during-agent-handoffs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-genai-tool-call-span-as-non-authoritative-for-token-accounting-during-agent-handoffs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2289,
    "python_slice_tokens": 319,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The GenAI semantic conventions define `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` as attributes of the *model invocation span* (`gen_ai.operation.name = chat`). They define tool invocations as *child spans* (`gen_ai.operation.name = execute_tool`) that carry `gen_ai.tool.name`, `gen_ai.tool.call.id`, and — critically — no usage attributes of...",
    "what_was_observed": "A two-agent pipeline: an orchestrator (Agent A) calls a retrieval tool implemented as a delegated sub-agent (Agent B), which itself performs a `chat` invocation against a model to synthesize a retrieval query, then calls a vector store. Both agents emit GenAI spans into one OTel trace via a shared collector. The trace contained, in order: - `chat` span (A, planning) — `gen_ai.usage.input_tokens=1840`, `output_tokens=...",
    "condition_of_validity": "The invariant holds — tool-call spans are non-authoritative for token accounting — under these conditions, all of which must be checked: 1. **Delegation depth > 0.** The tool call is implemented by a process other than the span emitter, evidenced by a descendant `chat` span whose `service.name` (resource attribute) differs from the `execute_tool` span's `ser...",
    "decision_boundary": "The boundary is between *structural attribution* (which span is the parent of which) and *fiscal attribution* (which span's usage counts toward which logical operation). The GenAI conventions give you structural attribution for free via parent-child span relationships. They do not give you fiscal attribution, because fiscal attribution requires knowing: - wh...",
    "operational_effect": "Downstream, a billing reconciliation job compared the trace-derived token total against the provider's invoice for the same hour. The trace total was 14% higher than the invoice — exactly the retry double-count plus a fan-out mis-attribution where a 3-way parallel retrieval had its 3 sub-agent `chat` spans summed into a single tool-call span that was then al..."
  },
  "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": "2bb4a5702f9bd4e6bb78c552048758329865ef7e95ce59fc5d4d748ee69ff652",
    "verified_classes": [
      "FiscalAttributionError"
    ],
    "verified_functions": [
      "attribute_usage"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "FiscalAttributionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
