stablyai/orca · error

Artifact create recovery record exceeds the supported size.

Error message

Artifact create recovery record exceeds the supported size.

What it means

Thrown by readIntent() when statSync reports a file size greater than MAX_ARTIFACT_CREATE_INTENT_BYTES (800KB RPC ceiling + 128KB = 928KB). A recovery record this large cannot be legitimate — intent payloads are small JSON — so it is rejected as a safety/DoS guard before reading. The same constant is enforced at write time (751).

Source

Thrown at src/main/artifacts/artifact-create-intent-store.ts:146

  }
  const scope = value as Partial<ArtifactShareScope>
  return [
    scope.cloudUserId,
    scope.cloudProfileId,
    scope.cloudOrganizationId,
    scope.apiOrigin
  ].every((field) => typeof field === 'string')
}

function readIntent(path: string): ArtifactCreateIntent {
  let size: number
  try {
    size = statSync(path).size
  } catch (error) {
    throw new Error('Artifact create recovery record could not be read safely.', { cause: error })
  }
  if (size > MAX_ARTIFACT_CREATE_INTENT_BYTES) {
    throw new Error('Artifact create recovery record exceeds the supported size.')
  }
  let parsed: unknown
  try {
    parsed = JSON.parse(readFileSync(path, 'utf8'))
  } catch (error) {
    throw new Error('Artifact create recovery record could not be read safely.', { cause: error })
  }
  if (!parsed || typeof parsed !== 'object') {
    throw new Error('Artifact create recovery record has an unsupported format.')
  }
  const intent = parsed as Partial<ArtifactCreateIntent>
  if (
    intent.version !== 1 ||
    typeof intent.sourceKey !== 'string' ||
    typeof intent.idempotencyKey !== 'string' ||
    !intent.idempotencyKey ||
    !isScope(intent.scope) ||
    !isWriteBody(intent.body)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Delete the offending intent file so the next create starts fresh (the create is not recoverable from corrupted state).
  2. Investigate what wrote >928KB to an intent path — check for path-collision in intentPath() and for rogue writers.
  3. Ensure no process holds an append-mode handle on the intents directory.

Example fix

// before
// recovery keeps failing on a 5MB intent file

// after
// quarantine + delete the corrupt intent, then re-share
if (statSync(path).size > MAX_ARTIFACT_CREATE_INTENT_BYTES) {
  await fs.promises.rename(path, `${path}.corrupt`)
}
Defensive patterns

Strategy: validation

Validate before calling

import { statSync } from 'node:fs'
import { MAX_ARTIFACT_CREATE_INTENT_BYTES } from '...'

function isIntentSizeSafe(path: string): boolean {
  try { return statSync(path).size <= MAX_ARTIFACT_CREATE_INTENT_BYTES }
  catch { return false }
}

if (!isIntentSizeSafe(path)) {
  // quarantine corrupt oversized intent before readIntent throws
  await fs.promises.rename(path, `${path}.corrupt`)
}

Type guard

null

Try / catch

try {
  return readIntent(path)
} catch (e) {
  if ((e as Error).message === 'Artifact create recovery record exceeds the supported size.') {
    await quarantineIntentFile(path)
    return null
  }
  throw e
}

Prevention

When it happens

Trigger: The intent file was truncated/concatenated with other data, a different file was written to the intent path, or external tooling appended to it. Possibly a corrupting disk write or a path collision.

Common situations: A log rotator or sync tool appended to the .json; two profileIds hashed to the same intent path; a partial write from a crashed process left a bloated file.

Related errors


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