Add LLM client compaction errors to traces (#9474)

* add llm client errors to traces

* update response json for telemetry

* prevent silent failures and properly log errored responses in streaming path

* remove double logging

---------

Co-authored-by: Amy Guan <amy@letta.com>
Co-authored-by: Kian Jones <kian@letta.com>
This commit is contained in:
amysguan
2026-02-13 15:44:09 -08:00
committed by Caren Thomas
parent 2f76f2c629
commit 80a0d1a95f
2 changed files with 31 additions and 19 deletions

View File

@@ -161,7 +161,11 @@ class LLMClientBase:
return
if response_json is None:
return
if error_msg:
response_json = {"error": error_msg, "error_type": error_type}
else:
logger.warning(f"Skipping telemetry: no response_json or error_msg (call_type={self._telemetry_call_type})")
return
try:
pydantic_actor = self.actor.to_pydantic() if hasattr(self.actor, "to_pydantic") else self.actor