chenglou/pretext · error · Error

symbol batch failed

Error message

symbol batch failed

What it means

Fallback message used when the /probe?batch=symbol-runs page posts {status:'error'} with a nullish message. The page's runProbeBatch (pages/probe.ts:886-891) wraps execution and posts an error with a message on any top-level throw; this string is the last-resort default when that message is missing. It indicates the batch never produced results, distinct from error 80's 'Missing symbol result' (ready status, partial results).

Solutions

  1. Restart the page server so pages/probe.ts matches the checked-in source.
  2. Inspect batchReport in the checker (temporary console.log(JSON.stringify(batchReport))) to recover the real page-side error.
  3. Re-run; the single-owner lock and side-channel POST can transiently error.
  4. If the recovered message is 'Unknown probe batch symbol-runs', the served bundle predates the symbol-runs batch name.

Example fix

// before
if (batchReport.status === 'error') {
  throw new Error(batchReport.message ?? 'symbol batch failed')
}

// after (surface the raw payload while debugging)
if (batchReport.status === 'error') {
  console.error('symbol batch error payload:', JSON.stringify(batchReport))
  throw new Error(batchReport.message ?? `symbol batch failed (raw: ${JSON.stringify(batchReport)})`)
}
Defensive patterns

Strategy: try-catch

Validate before calling

if (batchReport.status !== 'ready' && !batchReport.message) {
  console.error('symbol-check: batch errored with no message; likely a stale pages/probe.ts bundle. Raw:', JSON.stringify(batchReport))
}

Try / catch

try {
  const batchReport = await loadPostedReport(session, url, () => reportServer.waitForReport(null), requestId, reportBrowser, timeoutMs)
  if (batchReport.status === 'error') {
    throw new Error(batchReport.message ?? `symbol batch failed (raw: ${JSON.stringify(batchReport)})`)
  }
} catch (e) {
  console.error('symbol-check batch transport error:', e)
  // Restart the page server / re-run. Do not silently mark the run green.
  throw e
}

Prevention

When it happens

Trigger: Page-side getProbeBatchSpec(batch) threw 'Unknown probe batch' (a stale bundle could cause this for symbol-runs); runProbeBatch threw outside the per-case try/catch with a nullish error.message; transport desync posted an error object without a message field.

Common situations: Stale pages/probe.ts bundle served by an old page server; HMR half-applied; a code path that constructs {status:'error'} without a message.

Related errors


AI-assisted analysis of chenglou/pretext@ac49b09b7d (2026-08-12). Data as JSON: /api/errors/189ada76079bc6c1. Report an issue: GitHub.

Appendix: source

Thrown at scripts/symbol-check.ts:151

    serverProcess = pageServer.process
    const requestId = `${browser}-${Date.now()}-${Math.random().toString(36).slice(2)}`
    const reportServer = await startPostedReportServer<ProbeBatchReport>(requestId)

    try {
      const url =
        `${pageServer.baseUrl}/probe?batch=symbol-runs` +
        `&requestId=${encodeURIComponent(requestId)}` +
        `&reportEndpoint=${encodeURIComponent(reportServer.endpoint)}`
      const batchReport = await loadPostedReport(
        session,
        url,
        () => reportServer.waitForReport(null),
        requestId,
        reportBrowser,
        timeoutMs,
      )
      if (batchReport.status === 'error') {
        throw new Error(batchReport.message ?? 'symbol batch failed')
      }

      const batchResults = batchReport.results ?? []
      const reportsByLabel = new Map(batchResults.map(result => [result.label, result.report]))
      for (const testCase of SYMBOL_ORACLE_CASES) {
        if (!caseRunsInBrowser(testCase, browser)) continue
        const report = reportsByLabel.get(testCase.label)
        if (report === undefined) {
          throw new Error(`Missing symbol result for ${testCase.label}`)
        }
        printCaseResult(browser, testCase, report)
        if (!reportIsExact(report)) ok = false
      }
    } finally {
      reportServer.close()
    }
  } finally {
    session?.close()

View on GitHub (pinned to ac49b09b7d)