fix: stabilize AI coach chat against truncation and empty replies

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-11 06:27:06 +08:00
parent 7f1015f852
commit 401ee2f130
7 changed files with 111 additions and 32 deletions
+1 -1
View File
@@ -767,7 +767,7 @@ def format_chat_context_for_chat(
max_chars: int = CHAT_CONTEXT_MAX_CHARS,
) -> str:
overview = format_chat_position_overview(payload)
body = str(payload.get("text") or "").strip() or format_context_text(payload)
body = format_chat_context_slim(payload)
text = overview + "\n\n" + body
if len(text) <= max_chars:
return text