Retry failed videos with a new run and explain documents that fail after their build

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Iqbal
2026-10-27 21:48:00 +07:00
parent 8a02f68589
commit 9f9fc93dfe
4 changed files with 19 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ import { locale, t } from '../i18n'
type Phase = 'ready' | 'working' | 'answer' | 'failed'
function phaseOf(s: Source): Phase {
// A failed document blocks every whole-Brain schedule in the engine, even with a built knowledge base.
if (s.status === 'failed' || s.knowledge === 'failed') return 'failed'
if (s.knowledge === 'ready') return 'ready'
if (s.knowledge === 'building' || s.status !== 'completed') return 'working'
@@ -246,6 +247,10 @@ function KnowledgeAction({ doc }: { doc: Source }) {
text = t('brain.needsCredits', { need: credits ? t('brain.needsCreditsNeed', { credits }) : '' })
actions = <button className="btn small" disabled={busy} onClick={() => build.mutate()}>{t('common.retry')}</button>
break
case 'ready':
// Processing failed after the build: building again is refused, only removing it unblocks schedules.
text = t('brain.failedAfterBuild')
break
case 'failed':
text = d.error || t('brain.failed')
if (d.quote) actions = <button className="btn small" disabled={busy} onClick={() => build.mutate()}>{t('brain.retryWith', { credits: credits ?? '' })}</button>