From 690aa10b4772d2197b4497b6b76ac3eac2cfc659 Mon Sep 17 00:00:00 2001 From: andreicarpen Date: Sat, 18 Apr 2026 16:52:29 +0300 Subject: [PATCH] fix(report): detect failure from agent log as fallback to progress poll The progress.json update in the failure path is wrapped in a silent except: pass, so if the write fails (concurrent read, disk issue) the frontend never sees status === 'failed' and the resume banner stays hidden even though the generation is dead. Also, the agent log records action === 'error' synchronously inside the exception handler, which is a more reliable signal than polling progress.json. Flip reportStatus to 'failed' the moment that entry appears so the banner renders without waiting for the next 3s progress tick. Co-Authored-By: Claude Opus 4.7 --- frontend/src/components/Step4Report.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Step4Report.vue b/frontend/src/components/Step4Report.vue index efb9ce92..d3195851 100644 --- a/frontend/src/components/Step4Report.vue +++ b/frontend/src/components/Step4Report.vue @@ -2081,7 +2081,17 @@ const fetchAgentLog = async () => { stopPolling() // 滚动逻辑统一在循环结束后的 nextTick 中处理 } - + + // Agent 抛出错误时直接标记失败 —— 比 progress.json 轮询更即时, + // 也能兜底 update_progress 写失败的场景 + if (log.action === 'error') { + reportStatus.value = 'failed' + reportError.value = log.details?.error || log.details?.message || null + currentSectionIndex.value = null + emit('update-status', 'error') + stopPolling() + } + if (log.action === 'report_start') { startTime.value = new Date(log.timestamp) }