Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
chore: never skip params (#6364)
Kian Jones98edb3fe8626
diff --git a/letta/otel/tracing.py b/letta/otel/tracing.pyindex a646acd6b..cae7850d1 100644--- a/letta/otel/tracing.py+++ b/letta/otel/tracing.py@@ -250,22 +250,25 @@ def trace_method(func):"chunks", # Large chunk arrays}- # Max size for parameter value strings (1KB)- MAX_PARAM_SIZE = 1024- # Max total size for all parameters (100KB)- MAX_TOTAL_SIZE = 1024 * 100+ # Priority parameters that should ALWAYS be logged (exempt from opt-out)+ NEVER_SKIP_PARAMS = {"request_data"}++ # Max size for parameter value strings+ MAX_PARAM_SIZE = 1024 * 1024 * 2 # 2MB (supports ~500k tokens)+ # Max total size for all parameters+ MAX_TOTAL_SIZE = 1024 * 1024 * 4 # 4MBtotal_size = 0for name, value in param_items:try:- # Check if we've exceeded total size limit- if total_size > MAX_TOTAL_SIZE:+ # Check if we've exceeded total size limit (except for priority params)+ if total_size > MAX_TOTAL_SIZE and name not in NEVER_SKIP_PARAMS:span.set_attribute("parameters.truncated", True)span.set_attribute("parameters.truncated_reason", f"Total size exceeded {MAX_TOTAL_SIZE} bytes")break- # Skip parameters known to be large- if name in SKIP_PARAMS:+ # Skip parameters known to be large (opt-out list, but respect ALWAYS_LOG)+ if name in SKIP_PARAMS and name not in NEVER_SKIP_PARAMS:# Try to extract ID for observabilitytype_name = type(value).__name__id_info = ""