fix(chat): 允许空中止后继续上一段
- 跳过未产生正文的停止或失败尝试,但不越过真实用户消息 - 补充提前停止、失败后重试及用户发言边界回归
This commit is contained in:
@@ -301,7 +301,8 @@ export async function streamChat(
|
||||
content: string;
|
||||
status: string;
|
||||
}>(
|
||||
"SELECT role,content,status FROM dh_messages WHERE conversation_id=? ORDER BY sequence_id DESC LIMIT 1",
|
||||
// 空的中止/失败尝试没有新台词,继续时沿用上一段已说出的内容;不能跳过真实用户消息。
|
||||
"SELECT role,content,status FROM dh_messages WHERE conversation_id=? AND NOT (role='assistant' AND status IN ('stopped','failed') AND TRIM(content)='') ORDER BY sequence_id DESC LIMIT 1",
|
||||
[id],
|
||||
c,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user