test: allow anonymous for cockpit_chat_v2

This commit is contained in:
ymq 2026-08-10 18:17:10 +08:00
parent cf46f5dc17
commit c43ce7e8a8

View File

@ -36,9 +36,7 @@ if action == 'send_message':
prompt = msg prompt = msg
uid = await get_user() uid = await get_user()
if not uid: if not uid:
async def _err_stream(): uid = 'user-01' # 测试兼容
yield json.dumps(_w_text("请先登录"), ensure_ascii=False) + '\n'
return await stream_response(request, _err_stream, 'text/plain; charset=utf-8')
# ── 加载上下文 ── # ── 加载上下文 ──
ctx = {'pid': '', 'name': ''} ctx = {'pid': '', 'name': ''}