fix(chat): 恢复提前停止后的继续入口
- 以最近有效台词判断继续能力,停止前未出字时仍可重试
This commit is contained in:
@@ -184,7 +184,15 @@ export function DigitalHome({
|
||||
books = boot?.catalog.filter((c) => c.kind === "worldbook") ?? [],
|
||||
presets = boot?.catalog.filter((c) => c.kind === "preset") ?? [];
|
||||
const conversationId = conversation?.id;
|
||||
const lastReply = conversation?.messages.at(-1);
|
||||
// 尚未产生正文的失败/停止不算新台词,继续时接回上一段;真实用户消息仍是边界。
|
||||
const lastReply = conversation?.messages.findLast(
|
||||
(m) =>
|
||||
!(
|
||||
m.role === "assistant" &&
|
||||
["stopped", "failed"].includes(m.status) &&
|
||||
!m.content.trim()
|
||||
),
|
||||
);
|
||||
const canContinue =
|
||||
lastReply?.role === "assistant" &&
|
||||
["complete", "stopped"].includes(lastReply.status) &&
|
||||
|
||||
Reference in New Issue
Block a user