{"record":{"id":"be789b7d0543bd2f","repo":"linshenkx/prompt-optimizer","slug":"evaluation-image-evidence-label-is-missing-bo","errorCode":null,"errorMessage":"Evaluation image evidence \"${label}\" is missing both assetId and b64 data.","messagePattern":"Evaluation image evidence \"(.+?)\" is missing both assetId and b64 data\\.","errorType":"exception","errorClass":"EvaluationExecutionError","httpStatus":null,"severity":"error","filePath":"packages/core/src/services/evaluation/service.ts","lineNumber":851,"sourceCode":"    return resolvedMedia;\n  }\n\n  private async resolveEvaluationMediaItem(\n    mediaItem: EvaluationMediaItem\n  ): Promise<{ b64: string; mimeType?: string }> {\n    const label = mediaItem.label?.trim() || 'image';\n    const inlineB64 = mediaItem.b64?.trim() || '';\n    const assetId = mediaItem.assetId?.trim() || '';\n\n    if (inlineB64) {\n      return {\n        b64: inlineB64,\n        mimeType: mediaItem.mimeType?.trim() || 'image/png',\n      };\n    }\n\n    if (!assetId) {\n      throw new EvaluationExecutionError(\n        `Evaluation image evidence \"${label}\" is missing both assetId and b64 data.`\n      );\n    }\n\n    if (!this.imageStorageService) {\n      throw new EvaluationExecutionError(\n        `Image storage service is required to resolve evaluation image asset \"${assetId}\".`\n      );\n    }\n\n    const storedImage = await this.imageStorageService.getImage(assetId);\n    if (!storedImage?.data?.trim()) {\n      throw new EvaluationExecutionError(\n        `Failed to resolve evaluation image asset \"${assetId}\".`\n      );\n    }\n\n    return {","sourceCodeStart":833,"sourceCodeEnd":869,"githubUrl":"https://github.com/linshenkx/prompt-optimizer/blob/3e677b1d9f7e0493c142c175560531e7ae786dce/packages/core/src/services/evaluation/service.ts#L833-L869","documentation":"EvaluationExecutionError thrown by resolveEvaluationMediaItem for a single evidence item (identified by label, e.g. snapshot index/name) that has neither an assetId nor inline b64 data. The item cannot be turned into an image for the multimodal model, so execution fails even if other items are valid.","triggerScenarios":"Image-mode evaluation where at least one evidence item in the resolved set has empty/undefined assetId AND empty/undefined inlineB64 — for example an item created as a placeholder with only a mimeType, or a URL-only item.","commonSituations":"Optional evidence objects created with defaults ({mimeType:'image/png'} with no payload); fields named differently (imageId vs assetId) in caller data; b64 stripped by size-limiting middleware or log-safe serialization.","solutions":["Populate assetId or b64 on every evidence item you submit","Drop empty placeholder items from the evidence array before evaluation","Normalize your evidence schema to {assetId | b64, mimeType} before calling evaluate"],"exampleFix":"// before\nconst evidence = [{ mimeType: 'image/png' }, validItem];\n\n// after\nconst evidence = [validItem].filter(e => e.assetId || e.b64);\n// or: const evidence = [{ ...placeholder, assetId: uploadedId }, validItem];","handlingStrategy":"validation","validationCode":"const valid = evidence.filter(e => Boolean(e.assetId?.trim() || e.b64?.trim()));\nif (valid.length !== evidence.length) log.warn('Dropping evidence items without assetId/b64');\nawait svc.evaluate({ ...req, /* evidence: valid */ });","typeGuard":"const isUsableEvidence = (e: EvidenceItem): boolean => Boolean(e.assetId?.trim() || e.b64?.trim());","tryCatchPattern":null,"preventionTips":["Never insert placeholder evidence objects without payload","Schema-validate evidence shape ({assetId XOR b64, mimeType}) before submit"],"tags":["evaluation","image","evidence","validation"],"backgroundTag":"missing-media-payload","analyzedSha":"3e677b1d9f7e0493c142c175560531e7ae786dce","analyzedAt":"2026-08-27T21:29:16.709Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}