stablyai/orca · error · AggregateError

Benchmark process group authority recovery failed

Error message

Benchmark process group authority recovery failed

What it means

In signalValidatedProcessGroup, the process group has members but some have commands that do not contain the environmentFragment — meaning the group has been hijacked or a PID was recycled to a different process. The ownership error plus any recovery failures from compensateStoppedGroup are wrapped in an AggregateError.

Source

Thrown at config/scripts/macos-computer-helper-owner-loss-processes.mjs:256

      throw new AggregateError(
        [error, ...recoveryErrors],
        'Benchmark process group recovery failed before validation'
      )
    }
    throw error
  }
  if (members.length === 0) {
    const recoveryErrors = compensateStoppedGroup(pgid, groupState, operations)
    if (recoveryErrors.length > 0) {
      throw new AggregateError(recoveryErrors, 'Benchmark missing process group recovery failed')
    }
    return false
  }
  if (members.some((identity) => !identity.command.includes(environmentFragment))) {
    const ownershipError = new Error('Benchmark process group no longer belongs to this trial')
    const recoveryErrors = compensateStoppedGroup(pgid, groupState, operations)
    if (recoveryErrors.length > 0) {
      throw new AggregateError(
        [ownershipError, ...recoveryErrors],
        'Benchmark process group authority recovery failed'
      )
    }
    throw ownershipError
  }
  if (groupState.anchorPid) {
    try {
      operations.signalProcess(groupState.anchorPid, 'SIGCONT')
      groupState.anchorPid = null
    } catch (error) {
      if (error?.code === 'ESRCH') {
        groupState.anchorPid = null
      } else {
        throw new AggregateError([error], 'Benchmark pending anchor recovery failed')
      }
    }
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Inspect the process group members' commands with `ps -o pid,pgid,command` to detect PID recycling or foreign processes
  2. Make the environmentFragment more specific (include a unique temp dir path or trial ID from the environment)
  3. Ensure thorough cleanup between trials so no stale processes share the pgid
  4. Inspect AggregateError.errors: errors[0] is the ownership error, errors[1+] are recovery failures

Example fix

// before: environmentFragment is too generic, matches unrelated processes
const fragment = 'orca-computer-use-macos'

// after: include the trial-specific temp dir for uniqueness
const fragment = path.join(trialTempDir, 'orca-computer-use-macos')
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-check: verify all group members belong to this trial
const members = processIdentities(true).filter(id => id.pgid === pgid)
const foreign = members.filter(id => !id.command.includes(envFragment))
if (foreign.length > 0) {
  console.warn('Foreign processes in group:', foreign.map(f => f.pid))
  // do not signal — group has been recycled or hijacked
}

Try / catch

try {
  signalValidatedProcessGroup(pgid, envFragment, signal, groupState)
} catch (error) {
  if (error instanceof AggregateError && error.message.includes('authority recovery')) {
    // errors[0] = ownership error, errors[1+] = recovery failures
    const [ownershipErr] = error.errors
    console.error('Group authority lost:', ownershipErr.message)
    // investigate PID recycling — do not force-signal foreign processes
  }
  throw error
}

Prevention

When it happens

Trigger: At line 252, members.some(identity => !identity.command.includes(environmentFragment)) is true — a process in the pgid has a command string that doesn't contain the expected environment marker. Then compensateStoppedGroup also fails for non-ESRCH reasons. recoveryErrors.length > 0 at line 255.

Common situations: PID recycling: a helper process exited and its PID was reused by an unrelated process that inherited the same pgid; the environmentFragment is too generic and matches unrelated processes; a previous trial's processes were not fully cleaned up and share the pgid namespace.

Related errors


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