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 <noreply@anthropic.com>
This commit is contained in:
parent
0387dc7210
commit
690aa10b47
|
|
@ -2081,7 +2081,17 @@ const fetchAgentLog = async () => {
|
||||||
stopPolling()
|
stopPolling()
|
||||||
// 滚动逻辑统一在循环结束后的 nextTick 中处理
|
// 滚动逻辑统一在循环结束后的 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') {
|
if (log.action === 'report_start') {
|
||||||
startTime.value = new Date(log.timestamp)
|
startTime.value = new Date(log.timestamp)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue