stablyai/orca · error · Error

recovery persistence implementation changed; update this ben

Error message

recovery persistence implementation changed; update this benchmark

What it means

The benchmark fingerprints the persistLegacyWorkerTerminalRecoveryBatch method in src/main/runtime/orca-runtime.ts by slicing between two marker strings and asserting the slice still calls flushWorkspaceSessionOrThrowAsync and no longer calls flushOrThrow(). It throws when that fingerprint no longer matches, forcing the benchmark to be reconciled with the new implementation rather than silently timing the wrong code.

Source

Thrown at config/scripts/legacy-worker-recovery-persistence-benchmark.mjs:38

  throw new Error('fixture-mib and trials must be positive integers')
}

const runtimeSource = await readFile(runtimePath, 'utf8')
const recoveryStart = runtimeSource.indexOf(
  'private async persistLegacyWorkerTerminalRecoveryBatch'
)
const recoveryEnd = runtimeSource.indexOf(
  'private reconcileMissingLegacyWorkerTerminal',
  recoveryStart
)
const recoverySource = runtimeSource.slice(recoveryStart, recoveryEnd)
if (
  recoveryStart === -1 ||
  recoveryEnd === -1 ||
  !recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()') ||
  recoverySource.includes('flushOrThrow()')
) {
  throw new Error('recovery persistence implementation changed; update this benchmark')
}

const root = await mkdtemp(join(tmpdir(), 'orca-legacy-recovery-benchmark-'))
const filler = 'x'.repeat(fixtureMiB * 1024 * 1024)

function payload(state) {
  return JSON.stringify({ state, filler })
}

function writeDurableSync(path, body) {
  const tempPath = `${path}.sync.tmp`
  writeFileSync(tempPath, body)
  const fd = openSync(tempPath, 'r')
  try {
    fsyncSync(fd)
  } finally {
    closeSync(fd)
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Update the indexOf marker strings and the includes()/excludes() assertions to match the new recovery implementation.
  2. Confirm the benchmark still times the same durable-write pattern it claims to compare.
  3. If the method was intentionally removed, delete or rewrite the benchmark rather than loosening the guard.

Example fix

// before
const recoveryStart = runtimeSource.indexOf('private async persistLegacyWorkerTerminalRecoveryBatch')
if (!recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()')) {
  throw new Error('recovery persistence implementation changed; update this benchmark')
}

// after — point the fingerprint at the new method and flush call
const recoveryStart = runtimeSource.indexOf('private async persistLegacyWorkerRecoveryBatch')
if (!recoverySource.includes('await this.flushWorkspaceSessionAsync()')) {
  throw new Error('recovery persistence implementation changed; update this benchmark')
}
Defensive patterns

Strategy: validation

Validate before calling

// Verify the benchmark's fingerprint is still valid before running
const recoverySource = runtimeSource.slice(
  runtimeSource.indexOf('private async persistLegacyWorkerTerminalRecoveryBatch'),
  runtimeSource.indexOf('private reconcileMissingLegacyWorkerTerminal')
)
if (!recoverySource.includes('await this.flushWorkspaceSessionOrThrowAsync()')) {
  throw new Error('benchmark fingerprint stale; update markers to match new runtime')
}

Prevention

When it happens

Trigger: The method was renamed, moved, or removed; the flush call changed from flushWorkspaceSessionOrThrowAsync to another API; the end marker 'private reconcileMissingLegacyWorkerTerminal' shifted or was renamed.

Common situations: Refactoring the runtime recovery path; renaming the flush helper; reorganizing orca-runtime.ts methods.

Related errors


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