From cb63753db600335886022a15973cf4dfa2b9b788 Mon Sep 17 00:00:00 2001 From: jnjpng Date: Fri, 7 Nov 2025 15:11:11 -0800 Subject: [PATCH] fix: f string formatting separator in anthropic client (#6058) * fix * fix --------- Co-authored-by: Letta Bot --- letta/llm_api/anthropic_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/letta/llm_api/anthropic_client.py b/letta/llm_api/anthropic_client.py index a8c97f97..7861af86 100644 --- a/letta/llm_api/anthropic_client.py +++ b/letta/llm_api/anthropic_client.py @@ -1140,8 +1140,9 @@ def dedupe_tool_results_in_user_messages(messages: List[dict]) -> List[dict]: sep = "\n" if first["content"] and extra else "" first["content"] = f"{first['content']}{sep}{extra}" else: + sep = "\n" if first.get("content") else "" # Fallback: coerce to strings and concat - first["content"] = f"{first.get('content')}{'\n' if first.get('content') else ''}{extra}" + first["content"] = f"{first.get('content')}{sep}{extra}" any_deduped = True dedup_counts[tid] = dedup_counts.get(tid, 0) + 1 # Skip appending duplicate