fix(chat): 修复固资管理首轮问答残留中断与历史会话异常

This commit is contained in:
runny committed 2026-06-28 13:11:13 +08:00
1 parent 25876f94bd
commit 3b771fc0b6
16 files changed
+1042 -35

No files matched your search

@@ -42,6 +42,11 @@ export function createChatPageConversationApi(ctx: ChatPageConversationContext)
const prevConversationId = ctx.conversationId.value;
try {
/**
* 切换会话前先清空输入框草稿,避免 textarea DOM 里残留上一会话的可见文本,
* 但父级 `input` 已经是空字符串,最终出现“看起来输入了内容,发送时却被当成空串”的错觉。
*/
ctx.input.value = '';
ctx.onConversationIdChanging(id, prevConversationId);
const loaded = await listChatMessages(id, ctx.currentAgentId.value);
ctx.loadConversationState(id, Array.isArray(loaded) ? loaded : []);