fix: 在模型和工具调用期间进行打断后说完话错误退出问题

This commit is contained in:
Sakura-RanChen
2026-04-23 10:17:43 +08:00
parent 8c18e48b97
commit ff66b815a5
2 changed files with 3 additions and 1 deletions
@@ -9,6 +9,7 @@ TAG = __name__
async def handleAbortMessage(conn: "ConnectionHandler"):
conn.logger.bind(tag=TAG).info("Abort message received")
# 设置成打断状态,会自动打断llm、tts任务
conn.close_after_chat = False
conn.client_abort = True
conn.clear_queues()
# 打断客户端说话状态
@@ -35,7 +35,8 @@ def handle_exit_intent(conn: "ConnectionHandler", say_goodbye: str | None = None
try:
if say_goodbye is None:
say_goodbye = "再见,祝您生活愉快!"
conn.close_after_chat = True
if not conn.close_after_chat:
conn.close_after_chat = True
logger.bind(tag=TAG).info(f"退出意图已处理:{say_goodbye}")
return ActionResponse(
action=Action.RESPONSE, result="退出意图已处理", response=say_goodbye