stablyai/orca · error · Error

Watcher supervisor did not expose a live child

Error message

Watcher supervisor did not expose a live child

What it means

The harness grabs supervisor.child?.pid as the firstChildPid before sending SIGSEGV. If the supervisor has no live child (child is null or pid is undefined), the fault-injection step cannot proceed — there is nothing to crash. This usually means the supervisor failed to spawn its watcher child during setup.

Source

Thrown at config/scripts/runtime-file-watcher-fault-harness.mjs:132

        delivery: { includeDirectoryMetadata: true, maxEventsPerBatch: 200 },
        onInterruption: () => resolveInterruption()
      }
    )
    watcherCanaryDir = supervisor.canaryDir

    const beforeEvent = nextMatchingEvent(
      (listener) => {
        eventListener = listener
      },
      (event) => event.path === join(rootPath, 'before.txt'),
      'pre-crash watch event'
    )
    await writeFile(join(rootPath, 'before.txt'), 'before')
    await Promise.race([beforeEvent, watcherError])

    const firstChildPid = supervisor.child?.pid
    if (!firstChildPid) {
      throw new Error('Watcher supervisor did not expose a live child')
    }
    process.kill(firstChildPid, 'SIGSEGV')
    await Promise.race([interrupted, watcherError])

    const replacementChildPid = supervisor.child?.pid
    if (!replacementChildPid || replacementChildPid === firstChildPid) {
      throw new Error('Watcher supervisor did not replace the faulted child')
    }
    const afterEvent = nextMatchingEvent(
      (listener) => {
        eventListener = listener
      },
      (event) => event.path === join(rootPath, 'after.txt'),
      'post-crash watch event'
    )
    await writeFile(join(rootPath, 'after.txt'), 'after')
    await Promise.race([afterEvent, watcherError])

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check the supervisor's spawn error path — log supervisor.child and any error event before the SIGSEGV step.
  2. Rebuild native modules for the current Electron/Node ABI (pnpm run build:electron-vite + electron-rebuild).
  3. Confirm @parcel/watcher is installed and loadable: node -e "require('@parcel/watcher')".
  4. Ensure the supervisor is fully started (await its ready signal) before reading child.pid.

Example fix

// before
const firstChildPid = supervisor.child?.pid
if (!firstChildPid) throw new Error(...)
// after
await supervisor.whenReady?.()  // or the equivalent ready promise
const firstChildPid = supervisor.child?.pid
if (!firstChildPid) throw new Error(...)
Defensive patterns

Strategy: validation

Validate before calling

if (!supervisor?.child || typeof supervisor.child.pid !== 'number') {
  console.error('Watcher supervisor has no live child; check native module load')
  process.exit(1)
}

Type guard

function hasLiveChild(s: { child?: { pid?: number } | null }): s is { child: { pid: number } } {
  return !!s?.child && typeof s.child.pid === 'number'
}

Try / catch

if (!hasLiveChild(supervisor)) {
  throw new Error('Watcher supervisor did not expose a live child')
}

Prevention

When it happens

Trigger: WatcherProcessSupervisor started but its forked @parcel/watcher child exited immediately or was never spawned, so supervisor.child is null/undefined by the time the harness reads .pid.

Common situations: The watcher child crashed on startup (native module load failure — @parcel/watcher missing or wrong ABI); the supervisor was constructed in a mode that defers spawning; a race where the child exited between construction and the pid read.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/ef7466df764d16f5. Report an issue: GitHub.