From c943e8d363d1b412da65c47cf32c281a71fc85cd Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 13 Oct 2026 12:34:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(bioflow):=20sendCardResult=20=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BB=BB=E5=8A=A1=E5=90=8E=E8=A1=A5=20connectJobEvent?= =?UTF-8?q?s=20=E8=AE=A2=E9=98=85=EF=BC=8C=E6=81=A2=E5=A4=8D=E6=96=87?= =?UTF-8?q?=E4=BB=B6/=E5=8F=82=E6=95=B0=E5=BC=95=E5=AF=BC=E7=AD=89?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BA=8B=E4=BB=B6=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/stores/chat.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ui/src/stores/chat.js b/ui/src/stores/chat.js index 8643c8b..db2a5dd 100644 --- a/ui/src/stores/chat.js +++ b/ui/src/stores/chat.js @@ -2570,6 +2570,38 @@ export const useChatStore = defineStore('chat', { updateSessionQuiet(sessionId, { meta: { bioflow: { active_job_id: bf.active_job_id, chain: bf.chain || '' } }, }).catch(() => {}); + // 修复:skill 化 S3 改走 sendCardResult 后丢失了任务事件订阅—— + // 补上 connectJobEvents,把 stage_await_files / stage_await_confirm / + // stage_failed / job_done 桥接进消息块(guidance 气泡 + 各卡片)。 + try { + const bioflow = useBioflowStore(); + const jobId = bf.active_job_id; + bioflow.connectJobEvents(jobId, sessionId, { + onEvent: (type, data, seq) => { + const frame = patchBioflowEvent(aMsg, { type, data }); + if (frame) this.scrollSeq++; + if (type === 'stage_await_confirm' && data) { + patchBioflowGuidance(aMsg, data.guidance); + patchBioflowForm(aMsg, data); + this.scrollSeq++; + } else if (type === 'stage_await_files' && data) { + patchBioflowGuidance(aMsg, data.guidance || data.message); + patchBioflowFile(aMsg, data); + this.scrollSeq++; + } else if (type === 'stage_failed' && data) { + patchBioflowGuidance(aMsg, data.guidance); + patchBioflowDiagnosis(aMsg, data); + this.scrollSeq++; + } else if (type === 'job_done' && data) { + patchBioflowGuidance(aMsg, data.guidance); + if (data.delivery) patchBioflowDelivery(aMsg, data.delivery); + const blk = patchBioflowArchiveSuggest(aMsg, data.job_id || jobId); + if (blk) blk.jobId = data.job_id || jobId; + this.scrollSeq++; + } + }, + }); + } catch { /* EventSource 不可用:任务事件仍由快照兜底 */ } } try { await this._persistFinal(aMsg, sessionId, 'done', { raw: aMsg.raw });