fix: f string formatting separator in anthropic client (#6058)

* fix

* fix

---------

Co-authored-by: Letta Bot <noreply@letta.com>
This commit is contained in:
jnjpng
2025-11-07 15:11:11 -08:00
committed by Caren Thomas
parent 5e35887295
commit cb63753db6

View File

@@ -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