重构: AI流式断线保文StreamResult三分支+重试对齐决策a1,推进链落df-nodes

This commit is contained in:
2026-06-16 19:11:19 +08:00
parent 7d5cd4c89a
commit ba7f35552b
30 changed files with 1325 additions and 283 deletions

View File

@@ -115,6 +115,11 @@ export const aiApi = {
return invoke('ai_set_agent_max_iterations', { value })
},
/** 设置流式对话失败自动重试次数F-260616-07只重试流前失败0=不重试默认3上限10 */
setAgentMaxRetries(value: number): Promise<void> {
return invoke('ai_set_agent_max_retries', { value })
},
/** 列出本机 Claude 技能skills + commands + plugins */
listSkills(): Promise<SkillInfo[]> {
return invoke('ai_list_skills')

View File

@@ -199,7 +199,9 @@ export type AiChatEvent = ({
} | {
type: 'AiApprovalResult'; id: string; approved: boolean
} | {
type: 'AiCompleted'; total_tokens: number; prompt_tokens: number; completion_tokens: number
// UX-2025-04 / CR-30-2 / 决策 F-260616-07 a1: incomplete 标记流中途失败保文(网络中断),
// 前端据此差异化展示(如系统提示「⚠ 响应因网络中断不完整」)。正常完成/停止均为 undefined。
type: 'AiCompleted'; total_tokens: number; prompt_tokens: number; completion_tokens: number; incomplete?: boolean
} | {
type: 'AiError'; error: string; error_type?: AiErrorType
} | {
@@ -209,6 +211,9 @@ export type AiChatEvent = ({
} | {
// F-260616-03: 达 max_iterations 暂停态(后端仍 generating=true),前端展示操作卡询问继续/停止
type: 'AiMaxRoundsReached'
} | {
// F-260616-07: 流式调用自动重试提示(前端可在错误气泡内显示「重试 n/m」)
type: 'AiStreamRetry'; attempt: number; max_attempts: number
}) & {
conversation_id?: string
}