Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
fix(langgraph): prevent wrapping of ToolNode objects (#991)
Luka Aladashvili270c6ece2b9b
diff --git a/sdk/python/src/openlit/instrumentation/langgraph/langgraph.py b/sdk/python/src/openlit/instrumentation/langgraph/langgraph.pyindex c66a4f24..a1c17714 100644--- a/sdk/python/src/openlit/instrumentation/langgraph/langgraph.py+++ b/sdk/python/src/openlit/instrumentation/langgraph/langgraph.py@@ -515,7 +515,13 @@ def wrap_add_node(# Wrap the action functionnode_name = str(node_key) if not isinstance(node_key, str) else node_key- wrapped_action = create_wrapped_node(action, node_name)++ # FIX: Check if action is a function/routine.+ # If it is a class instance (like ToolNode), do NOT wrap it.+ if inspect.isroutine(action):+ wrapped_action = create_wrapped_node(action, node_name)+ else:+ wrapped_action = action# Call original add_node with wrapped actionif args and len(args) > 1: