fix: use chr(10) for newlines in NDJSON stream

This commit is contained in:
ymq 2026-08-08 16:44:46 +08:00
parent 70481ad17b
commit d435c8b5ae

View File

@ -200,7 +200,7 @@ if action == 'send_message':
ctx = await _load_ctx(sor, uid)
model = await _sel_model(sor, user_model_id)
if not model:
yield json.dumps({"type":"widget","widget":_w_card("❌ 错误",_w_text("无可用LLM"),"error")},ensure_ascii=False)+'\n'
yield json.dumps({"type":"widget","widget":_w_card("❌ 错误",_w_text("无可用LLM"),"error")},ensure_ascii=False)+chr(10)
return
repos_str = ', '.join([r['n'] for r in ctx['repos']]) or '无'