From 56d26b2fa49237a9bf634f6650a76fd441b7441d Mon Sep 17 00:00:00 2001 From: 3un01a <3un01a@plasticlabs.ai> Date: Wed, 8 Apr 2026 14:11:46 -0700 Subject: [PATCH] feat: Add trace generation for all LLM calls --- src/dreamer/specialists.py | 1 + src/utils/clients.py | 8 ++++---- src/utils/summarizer.py | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dreamer/specialists.py b/src/dreamer/specialists.py index 608db3b0..0aead553 100644 --- a/src/dreamer/specialists.py +++ b/src/dreamer/specialists.py @@ -219,6 +219,7 @@ If you update it, send the full deduplicated list and remove stale entries. messages=messages, track_name=f"Dreamer/{self.name}", iteration_callback=iteration_callback, + trace_name=f"dreamer_{self.name}", ) # Log metrics diff --git a/src/utils/clients.py b/src/utils/clients.py index 1c042bff..5bba9026 100644 --- a/src/utils/clients.py +++ b/src/utils/clients.py @@ -1499,9 +1499,9 @@ async def honcho_llm_call( result: ( HonchoLLMCallResponse[Any] | AsyncIterator[HonchoLLMCallStreamChunk] ) = await decorated() - if trace_name and isinstance(result, HonchoLLMCallResponse): + if isinstance(result, HonchoLLMCallResponse): log_reasoning_trace( - task_type=trace_name, + task_type=trace_name or "untagged", llm_settings=llm_settings, prompt=prompt, response=result, @@ -1549,9 +1549,9 @@ async def honcho_llm_call( stream_final=stream_final_only, iteration_callback=iteration_callback, ) - if trace_name and isinstance(result, HonchoLLMCallResponse): + if isinstance(result, HonchoLLMCallResponse): log_reasoning_trace( - task_type=trace_name, + task_type=trace_name or "untagged", llm_settings=llm_settings, prompt=prompt, response=result, diff --git a/src/utils/summarizer.py b/src/utils/summarizer.py index ca1965b9..856e9d34 100644 --- a/src/utils/summarizer.py +++ b/src/utils/summarizer.py @@ -215,6 +215,7 @@ async def create_short_summary( llm_settings=settings.SUMMARY, prompt=prompt, max_tokens=settings.SUMMARY.MAX_TOKENS_SHORT, + trace_name="short_summary", ) @@ -240,6 +241,7 @@ async def create_long_summary( llm_settings=settings.SUMMARY, prompt=prompt, max_tokens=settings.SUMMARY.MAX_TOKENS_LONG, + trace_name="long_summary", )