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:
andreicarpen 2026-04-18 16:52:29 +03:00
parent 0387dc7210
commit 690aa10b47
1 changed files with 11 additions and 1 deletions

View File

@ -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)
}