feat(langchain): Record run_name as gen_ai.function_id on Invoke Agent Spans
#5926
+472
−3
@sentry/warden / warden: find-bugs
completed
Apr 22, 2026 in 3m 11s
1 issue
find-bugs: Found 1 issue (1 low)
Low
Unnecessary list() call on invoke() return value - `tests/integrations/langchain/test_langchain.py:795-800`
The test wraps agent_executor.invoke() with list(), but invoke() returns a dictionary, not an iterator. Using list() on a dict produces a list of keys (e.g., ['input', 'output']), which is not meaningful for this test. Unlike stream() which returns an iterator that should be consumed with list(), invoke() returns the result directly. While this doesn't cause the test to fail (the invoke still runs and span data is captured), it's misleading code that suggests the API works differently than it does.
Also found at:
tests/integrations/langchain/test_langchain.py:1090-1094
Duration: 3m 7s · Tokens: 1.0M in / 12.2k out · Cost: $1.57 (+extraction: $0.00, +merge: $0.00, +fix_gate: $0.00)
Loading