stablyai/orca · error · Error

Expected baseline helper to remain after abrupt owner loss

Error message

Expected baseline helper to remain after abrupt owner loss

What it means

Thrown when running with --expect retained (baseline mode). After SIGKILL-ing the sidecar, the benchmark expects the baseline helper to survive for at least RETAIN_PROOF_MS (3s). If the helper exits within that window, the baseline is incorrectly coupled to the owner's lifecycle — a baseline helper should be independent of the authenticated owner.

Source

Thrown at config/scripts/macos-computer-helper-owner-loss-benchmark.mjs:358

    const connected = await sampleProcess(helper.pid)
    const invalidSocketPath = socketPathFromCommand(helper.command)
    invalidPeer = await connectInvalidPeer(invalidSocketPath)
    invalidPeerRejected = true
    const survivedClaimDeadline =
      performance.now() - authenticatedAt >= OWNER_HOLD_MS && isProcessAlive(helper.pid)

    sidecar.child.kill('SIGKILL')
    await waitForChildExit(sidecar.child, PROCESS_EXIT_TIMEOUT_MS)
    const abruptExitMs = await waitForProcessExit(
      helper,
      expectation === 'reaped' ? PROCESS_EXIT_TIMEOUT_MS : RETAIN_PROOF_MS
    )
    const helperExitedAfterAbruptLoss = abruptExitMs !== null
    if (expectation === 'reaped' && !helperExitedAfterAbruptLoss) {
      throw new Error('Expected helper to exit after abrupt authenticated owner loss')
    }
    if (expectation === 'retained' && helperExitedAfterAbruptLoss) {
      throw new Error('Expected baseline helper to remain after abrupt owner loss')
    }
    const postLossRssBytes = helperExitedAfterAbruptLoss ? 0 : processSnapshot(helper.pid).rssBytes
    await stopProcess(helper)
    helper = null
    invalidPeer.destroy()
    invalidPeer = null

    const gracefulExitMs = await verifyGracefulClose()
    return {
      authenticated: session.authenticated,
      survivedClaimDeadline,
      invalidPeerRejectedAndDidNotRetain: invalidPeerRejected && helperExitedAfterAbruptLoss,
      connectedRssBytes: connected.rssBytes,
      connectedCpuMilliseconds: Math.max(
        0,
        Math.round((connected.cpuTimeSeconds - initial.cpuTimeSeconds) * 1_000)
      ),
      activeRequests,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Ensure the baseline helper is spawned detached (setsid / new process group) so it does not receive the sidecar's process-group SIGKILL
  2. Verify no owner-loss watchdog runs in the baseline build configuration
  3. Check that RETAIN_PROOF_MS (3s) is shorter than the baseline's natural lifetime — if the baseline crashes on its own, investigate startup failures

Example fix

// before: helper inherits the sidecar's process group, dies on cascading SIGKILL
spawn(helperPath, args, { stdio: 'ignore' })

// after: detach into its own session/group so it survives owner loss
const child = spawn(helperPath, args, { detached: true, stdio: 'ignore' })
child.unref()
Defensive patterns

Strategy: try-catch

Validate before calling

// Before running the retained benchmark, verify the baseline helper is detached
const helper = await waitForHelper(sidecarPid)
// pgid === pid confirms the helper is its own session leader
if (helper.pgid !== helper.pid) {
  throw new Error('Baseline helper is not a session leader — it will die with the sidecar')
}

Try / catch

try {
  const result = await runInternalTrial('retained')
} catch (error) {
  if (error.message.includes('Expected baseline helper to remain')) {
    // baseline helper died with owner — check process group configuration
    console.error('Baseline helper is coupled to owner lifecycle:', error)
  }
  throw error
}

Prevention

When it happens

Trigger: Called from runInternalTrial('retained') at line 357. waitForProcessExit(helper, 3000) returns a non-null elapsed time because the helper exited within 3s. helperExitedAfterAbruptLoss is true, so the assertion fires.

Common situations: The baseline helper was spawned in the same process group as the sidecar and received the cascading SIGKILL via kill(-pgid); the baseline build inadvertently includes owner-loss detection that should only exist in the reaped build; a signal handler terminates the helper on parent exit.

Related errors


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