重构: 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

@@ -29,6 +29,13 @@ async function detachPanel() {
localStorage.setItem('df-ai-gen', state.generatingConvId)
localStorage.setItem('df-ai-text', state.currentText)
}
// 主窗口 state 与分离窗口 state 独立(各自 webview 独立 JS context,
// stores/ai.ts 模块级单例仅在同 webview 内共享),清主窗口 state 不影响分离窗口生成态。
// 分离窗口接管生成后,主窗口不应再持生成态残留(防重开面板时 UI 显生成中幽灵/进度条)。
// watchdog 在主窗口 AiChat 卸载(App.vue v-if detached)→ stopListener → clearStreamWatchdog 时已清,
// 此处仅清内存 state 视觉残留;localStorage 快照保留供 resumeInDetached 恢复。
state.streaming = false
state.generatingConvId = null
const convId = state.activeConversationId
const sep = convId ? `?conv=${encodeURIComponent(convId)}` : ''
const url = window.location.origin + window.location.pathname + '#/ai-detached' + sep