优化: 会话状态 per-conv 化与交互守卫

- 待审批跨会话 per-conv 合并,审批类事件全局放行
- 看门狗/重试计数/流式残段按会话键控迁移
- 输入草稿与子代理完成卡数据按会话隔离
- 切换兜底 activeId,收敛守卫防幽灵气泡
- 发送错误按限流/额度/网络分类文案
This commit is contained in:
lxy
2026-10-03 15:35:15 +08:00
parent d406a31722
commit b4fafa0e9a
13 changed files with 460 additions and 96 deletions
+5
View File
@@ -93,6 +93,11 @@ export const aiApi = {
return invoke('ai_continue_loop', { conversationId })
},
/** 流中断探测:后端按真实状态返回 generating/resumed/finished,供看门狗超时自动续跑 */
resumeInterrupted(conversationId: string): Promise<'generating' | 'resumed' | 'finished'> {
return invoke('ai_resume_interrupted', { conversationId })
},
/**
* 停止 agentic 循环并走完成流程(达 max_iterations 暂停态点停止)。
* 后端 ai_stop_loop:复位 generating + emit AiCompleted(暂停前已 save)。
+5
View File
@@ -449,6 +449,11 @@ export type AiChatEvent = ({
* undefined/false=真实值。前端 MessageList 据此标注『估算』区分 estimated vs real。
*/
is_estimated?: boolean
/**
* incomplete 场景细分(达上限自动收尾 vs 网络中断,前端据此区分提示文案):
* "max_rounds"=达最大轮次后端自动收尾;其他/缺省=网络中断等异常。
*/
incomplete_reason?: string
incomplete?: boolean; pinned_goals?: GoalEntry[]
} | {
type: 'AiError'; error: string; error_type?: AiErrorType