{"record":{"id":"192e23a329067888","repo":"deepseek-ai/deepseek-harness","slug":"attachment-write-failed-192e23","errorCode":"ATTACHMENT_WRITE_FAILED","errorMessage":"Encoded model-request image does not match its verified 8-bit sRGB metadata.","messagePattern":"Encoded model-request image does not match its verified 8-bit sRGB metadata\\.","errorType":"exception","errorClass":"AttachmentError","httpStatus":null,"severity":"error","filePath":"packages/attachment/attachment-local/src/request-image.ts","lineNumber":221,"sourceCode":"      || detected.width > maximum.width || detected.height > maximum.height\n      || !encodedAlphaIsCompatible(expectedAlpha, detected)) return undefined\n    return { data, mediaType: detected.mediaType, width: detected.width, height: detected.height, hasAlpha: detected.hasAlpha }\n  } catch (error: unknown) {\n    if ((error as NodeJS.ErrnoException | null)?.code === 'ENOENT') return undefined\n    signal?.throwIfAborted()\n    return undefined\n  }\n}\n\nasync function verifyRequestImage(\n  image: EncodedRequestImage,\n  expectedAlpha: boolean,\n): Promise<VerifiedRequestImage> {\n  const detected = await detectImage(image.data)\n  if (detected.depth !== 'uchar' || detected.space !== 'srgb'\n    || detected.width !== image.width || detected.height !== image.height\n    || detected.mediaType !== image.mediaType || !encodedAlphaIsCompatible(expectedAlpha, detected)) {\n    throw new AttachmentError(\n      'Encoded model-request image does not match its verified 8-bit sRGB metadata.',\n      'ATTACHMENT_WRITE_FAILED',\n    )\n  }\n  return { ...image, hasAlpha: detected.hasAlpha }\n}\n\nasync function writeCached(path: string, data: Uint8Array): Promise<void> {\n  await mkdir(dirname(path), { recursive: true, mode: 0o700 })\n  const temporary = `${path}.${randomUUID()}.tmp`\n  try {\n    await writeFile(temporary, data, { mode: 0o600, flag: 'wx' })\n    await rename(temporary, path)\n  } finally {\n    await rm(temporary, { force: true })\n  }\n}\n","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/attachment/attachment-local/src/request-image.ts#L203-L239","documentation":"Error \"Encoded model-request image does not match its verified 8-bit sRGB metadata.\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/attachment/attachment-local/src/request-image.ts:221 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-encode the image as 8-bit sRGB so the bytes match their verified metadata."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}