fix: define msg_id and agent_reply before async block to prevent UnboundLocalError

This commit is contained in:
yumoqing 2026-08-02 23:31:46 +08:00
parent 73935ae652
commit a117d2ffd7

View File

@ -288,6 +288,8 @@ if action == 'send_message':
uid = await get_user()
org_id = await get_userorgid() or '0'
msg_id = '' # always defined, even on error
agent_reply = ''
async with DBPools().sqlorContext(dbname) as sor:
# 1. Load context and model