From b9bc90ffb0a4fe29fb1ab067ed93c2e89f4f1a7d Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 13 Oct 2026 11:10:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(bioflow):=20=E8=AF=8A=E6=96=AD=E5=8D=A1?= =?UTF-8?q?=E6=8E=A5=E7=BA=BF=E2=80=94=E2=80=94stage=5Ffailed=20=E8=A1=A5?= =?UTF-8?q?=20G13=20=E9=94=99=E8=AF=AF=E5=AF=B9=E8=B1=A1+guidance=EF=BC=8C?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=AF=8A=E6=96=AD=E5=8D=A1=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=20(#009-=E8=AF=8A=E6=96=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bioflow_service/app/services/bioflow/runner.py | 10 ++++++++++ ui/src/stores/chat.js | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/bioflow_service/app/services/bioflow/runner.py b/bioflow_service/app/services/bioflow/runner.py index ef9c7f4..837c452 100644 --- a/bioflow_service/app/services/bioflow/runner.py +++ b/bioflow_service/app/services/bioflow/runner.py @@ -27,6 +27,7 @@ from pathlib import Path from typing import Any, Awaitable, Callable from .catalog import StageCatalog +from .errors import classify_reason from .events import EventBus from .manifests import ManifestError, locate_manifest, parse_manifest from .recovery import RecoveryBudget @@ -1059,10 +1060,19 @@ class Runner: self._set_stage(record, stage, status=STAGE_FAILED, finished_at=_now_iso(), error=reason) await self._persist_stage(record, stage) + cat, diag, retry, actions = classify_reason(reason, exit_code=exit_code) + guidance = f"阶段 {stage} 执行失败:{reason}。" + if actions: + guidance += "建议:" + ";".join(actions) + "。" self.events.publish("stage_failed", { "job_id": record.id, "stage": stage, "exit_code": exit_code if exit_code is not None else -1, "reason": reason, + "category": cat, "code": reason, "summary": reason, + "diagnosis_status": diag, + "retryable_without_change": retry, + "suggested_actions": actions, + "guidance": guidance, }) def _prefix_for(self, record: JobRecord, stage: str) -> str | None: diff --git a/ui/src/stores/chat.js b/ui/src/stores/chat.js index b45a132..8643c6b 100644 --- a/ui/src/stores/chat.js +++ b/ui/src/stores/chat.js @@ -1170,6 +1170,7 @@ export const useChatStore = defineStore('chat', { if (frame) this.scrollSeq++; if (type === 'stage_await_confirm' && data) { patchBioflowGuidance(m, data.guidance); patchBioflowForm(m, data); this.scrollSeq++; } else if (type === 'stage_await_files' && data) { patchBioflowGuidance(m, data.guidance || data.message); patchBioflowFile(m, data); this.scrollSeq++; } + else if (type === 'stage_failed' && data) { patchBioflowGuidance(m, data.guidance); patchBioflowDiagnosis(m, data); this.scrollSeq++; } else if (type === 'job_done' && data) { patchBioflowGuidance(m, data.guidance); const ab = patchBioflowArchiveSuggest(m, data.job_id || jobId); @@ -2272,6 +2273,10 @@ export const useChatStore = defineStore('chat', { 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); const blk = patchBioflowArchiveSuggest(aMsg, data.job_id || jobId);