JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix: 修复 SystemMessage 在历史消息中导致 API 报错的问题
pickstarb6c6a448e8bd
diff --git a/jiuwenclaw/agentserver/react_agent.py b/jiuwenclaw/agentserver/react_agent.pyindex 61388bfb36..6f42cc093c 100644--- a/jiuwenclaw/agentserver/react_agent.py+++ b/jiuwenclaw/agentserver/react_agent.py@@ -362,6 +362,8 @@ class JiuClawReActAgent(ReActAgent):history_messages = context_window.get_messages()history_snapshot = list(history_messages)+ # Filter out SystemMessage from history to avoid "System message must be at the beginning" error+ history_messages = [m for m in history_messages if not isinstance(m, SystemMessage)]messages = [*system_messages, *history_messages]compression_to_show = []