stablyai/orca · error · Error
Recorded benchmark helper identity is invalid
Error message
Recorded benchmark helper identity is invalid
What it means
validateDetachedIdentity checks that the identity object has a positive integer pid, pgid equals pid (the process is its own process-group leader, confirming it was detached via setsid), command is a string containing the expected fragment (helperPath). If any check fails, the identity is considered corrupt or from a different process.
Source
Thrown at config/scripts/macos-computer-helper-owner-loss-processes.mjs:113
if (errors.length > 1) {
throw new AggregateError(errors, 'Benchmark exact-command cleanup failed')
}
return true
}
function sleepSync(milliseconds) {
Atomics.wait(sleepBuffer, 0, 0, milliseconds)
}
function validateDetachedIdentity(identity, expectedCommandFragment) {
if (
!Number.isInteger(identity?.pid) ||
identity.pid <= 0 ||
identity.pgid !== identity.pid ||
typeof identity.command !== 'string' ||
!identity.command.includes(expectedCommandFragment)
) {
throw new Error('Recorded benchmark helper identity is invalid')
}
}
function sameIdentity(left, right) {
return left?.pid === right?.pid && left?.pgid === right?.pgid && left?.command === right?.command
}
function processIdentities(includeEnvironment = false) {
const args = includeEnvironment
? ['eww', '-axo', 'pid=,pgid=,command=']
: ['-axo', 'pid=,pgid=,command=']
const output = execFileSync('ps', args, {
encoding: 'utf8',
maxBuffer: 20 * 1024 * 1024
})
return output
.split('\n')
.map((line) => line.trim().match(/^(\d+)\s+(\d+)\s+(.+)$/))View on GitHub (pinned to 1136503c6a)
Solutions
- Verify the helper is spawned with detached:true so it becomes its own process-group leader (pgid === pid)
- Check the recorded identity JSON file: cat the helper.json record and verify pid, pgid, command fields
- Ensure the expectedCommandFragment (helperPath constant) matches the actual helper binary path in the command string
- Use writeProcessRecord's atomic rename to prevent corrupt records from partial writes
Example fix
// before: helper not detached, pgid !== pid
spawn(helperPath, args, { stdio: 'ignore' })
// identity = { pid: 123, pgid: 100, command: '...' } → fails validation
// after: detach so pgid === pid
const child = spawn(helperPath, args, { detached: true, stdio: 'ignore' })
child.unref()
// identity = { pid: 123, pgid: 123, command: '...' } → passes Defensive patterns
Strategy: type-guard
Validate before calling
// Validate identity shape before passing to signalProcessIdentity
function isValidDetachedIdentity(identity, expectedFragment) {
return Number.isInteger(identity?.pid) &&
identity.pid > 0 &&
identity.pgid === identity.pid &&
typeof identity.command === 'string' &&
identity.command.includes(expectedFragment)
} Type guard
function isValidDetachedIdentity(identity, expectedFragment) {
return Number.isInteger(identity?.pid) &&
identity.pid > 0 &&
identity.pgid === identity.pid &&
typeof identity.command === 'string' &&
identity.command.includes(expectedFragment)
} Prevention
- Ensure the helper is spawned with detached:true so pgid === pid
- Verify the helperPath constant matches the actual binary path in the command string
- Use the atomic writeProcessRecord (rename-based) to prevent corrupt JSON from partial writes
When it happens
Trigger: The identity record has pgid !== pid (helper was not detached / not a session leader); command does not include the expected helperPath fragment (wrong binary or stale record); pid is not a positive integer (corrupt JSON); command is not a string.
Common situations: Helper was spawned without detached:true so pgid differs from pid; the helper binary path changed but the record was written with an old path; JSON record on disk is corrupt from a partial write; the record is from a different helper version.
Related errors
- Package version is not valid semver: ${baseVersion}
- Adhoc build timestamp is invalid.
- Adhoc label has no usable characters: ${JSON.stringify(label
- ${name} must be a positive integer, received ${value}
- ORCA_ADVERTISED_URL_BENCH_ROUNDS must be even
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/98a035a8649a5abe.
Report an issue: GitHub.