#3261·deepeval

AgentCore TOOL spans drop gen_ai.tool.call.result and crash on non-dict tool args (Strands parity)

Author: feiiiiii5Created Sep 10, 2026Updated Sep 10, 2026

Repro

Two symmetric gaps vs deepeval/integrations/strands/instrumentator.py (hardened in #3103), both in deepeval/integrations/agentcore/instrumentator.py:

A. Non-dict tool args raise / poison the span. _extract_tool_call_from_tool_span in AgentCore lacks the or {} + non-dict wrap that Strands got in #3103:

python
from deepeval.integrations.agentcore.instrumentator import _extract_tool_call_from_tool_span
class S: attributes = {'gen_ai.tool.name': 't', 'gen_ai.tool.call.arguments': '[1, 2, 3]'}
_extract_tool_call_from_tool_span(S())  # ValidationError: input_parameters should be a valid dictionary
# same input on Strands returns ToolCall(input_parameters={'input': [1, 2, 3]})
# 'null' yields input_parameters=None on AgentCore vs {} on Strands

The raise is swallowed by on_end's try/except (debug log only), so the whole _serialize_framework_attrs for that span is silently dropped.

B. gen_ai.tool.call.result ignored on TOOL spans. AgentCore TOOL branch only checks traceloop.entity.output / gen_ai.tool.output; Strands (post-#3103) also checks output_text and gen_ai.tool.call.result and writes back tc.output. A TOOL span carrying only gen_ai.tool.call.result gets SPAN_OUTPUT=None and tools_called[0].output=None on AgentCore, while Strands records both.

Root cause

#3103 hardened only strands/instrumentator.py; the near-identical sister function and TOOL-output block in agentcore/instrumentator.py (same GenAI conventions, header claims parity) were left behind.

Options

a) Mirror Strands hardening into AgentCore (input wrap + output/result key + tc.output write-back) — smallest, direction pre-approved by #3103 merge. b) Extract a shared helper for both interceptors — larger refactor, more review surface. c) Do nothing — accept silent span-attr loss on AgentCore TOOL spans.

I prefer (a) and will open a PR with a regression test in tests/test_integrations/test_agentcore/test_span_interceptor.py.