From eb68473844fef871cef7fad07e6258982dba271e Mon Sep 17 00:00:00 2001 From: qc Date: Fri, 20 Mar 2026 02:56:53 +0000 Subject: [PATCH] Fix: ensure system message is always first for cross-model compatibility AI-assisted: Yes Testing: Fully tested --- backend/app/api/websocket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/api/websocket.py b/backend/app/api/websocket.py index 4dbd3836..1f444cd0 100644 --- a/backend/app/api/websocket.py +++ b/backend/app/api/websocket.py @@ -233,7 +233,7 @@ async def call_llm( _warn_threshold_96 = _max_tool_rounds - 2 if round_i == _warn_threshold_80: api_messages.append(LLMMessage( - role="system", + role="user", content=( f"⚠️ 你已使用 {round_i}/{_max_tool_rounds} 轮工具调用。" "如果当前任务尚未完成,请尽快保存进度到 focus.md," @@ -242,7 +242,7 @@ async def call_llm( )) elif round_i == _warn_threshold_96: api_messages.append(LLMMessage( - role="system", + role="user", content=f"🚨 仅剩 2 轮工具调用。请立即保存进度到 focus.md 并设置续接触发器。", ))