Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: 1210 error on glm 4.7 (#9994)

Ari Webb946ff600cd50
diff --git a/letta/llm_api/zai_client.py b/letta/llm_api/zai_client.py
index 19e5eeae2..08ad51128 100644
--- a/letta/llm_api/zai_client.py
+++ b/letta/llm_api/zai_client.py
@@ -74,6 +74,18 @@ class ZAIClient(OpenAIClient):
if "max_completion_tokens" in data:
data["max_tokens"] = data.pop("max_completion_tokens")
+ # Strip reasoning fields from input messages — ZAI rejects these as invalid parameters (error 1210)
+ if "messages" in data:
+ for msg in data["messages"]:
+ if isinstance(msg, dict):
+ for field in (
+ "reasoning_content",
+ "reasoning_content_signature",
+ "redacted_reasoning_content",
+ "omitted_reasoning_content",
+ ):
+ msg.pop(field, None)
+
# Sanitize empty text content — ZAI rejects empty text blocks
if "messages" in data:
for msg in data["messages"]: