deepseek-ai/deepseek-harness · error · AttachmentError

ATTACHMENT_CORRUPT

ATTACHMENT_CORRUPT

Error message

Prepared attachment bytes do not match their reference.

What it means

Error "Prepared attachment bytes do not match their reference." thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/attachment/attachment-local/src/store.ts:191

    durableHomes.add(home)
  }
  return home
}

/**
 * Publish one already verified normalized image below a versioned attachment root.
 * @param root - absolute `DSH_HOME/attachments/v1` root.
 * @param prepared - deterministic normalized bytes and reference.
 * @returns durable content-addressed normalized image reference.
 */
export async function commitPreparedImageFile(
  root: string,
  prepared: PreparedImageFile,
): Promise<ImageAttachmentRef> {
  const normalized = prepared.data
  const sha256 = ensureReference(prepared.ref)
  if (digest(normalized) !== sha256 || normalized.byteLength !== prepared.ref.bytes) {
    throw new AttachmentError('Prepared attachment bytes do not match their reference.', 'ATTACHMENT_CORRUPT')
  }
  const bucket = join(root, 'objects', sha256.slice(0, 2))
  const staging = join(root, 'tmp')
  // Establish DSH_HOME itself against the filesystem root once per process.
  // Every process performs that proof independently, so observing a directory
  // another process created can never be mistaken for durable publication.
  const boundary = await ensureDurableHome(dirname(dirname(resolve(root))))
  await ensureDurableDirectory(bucket, boundary)
  await ensureDurableDirectory(staging, boundary)
  const temporary = join(staging, randomUUID())
  const target = objectPath(root, sha256)
  let handle
  try {
    handle = await open(temporary, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY, 0o600)
    await handle.writeFile(normalized)
    await handle.sync()
    await handle.close()
    handle = undefined

View on GitHub (pinned to b150a551b8)

Solutions

  1. Re-prepare the attachment so its bytes hash to the reference id.

When it happens

Trigger: Thrown at packages/attachment/attachment-local/src/store.ts:191 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/4e462230a116b64d. Report an issue: GitHub.