linshenkx/prompt-optimizer · error · EvaluationExecutionError
No valid image evidence could be resolved for evaluation.
Error message
No valid image evidence could be resolved for evaluation.
What it means
EvaluationExecutionError thrown by resolveEvaluationMedia when, after iterating all evidence items, zero usable images were resolved (every item failed to produce assetId/b64 media, e.g. all skipped or all resolved to nothing). The multimodal evaluator has no images to send, so execution aborts.
Source
Thrown at packages/core/src/services/evaluation/service.ts:830
resolvedMedia.push({
label: mediaItem.label.trim(),
role: request.type === 'compare' ? 'compare-output-image' : 'result-output-image',
snapshotId: snapshot.id.trim(),
snapshotLabel: snapshot.label.trim(),
blockLabel: block.label.trim(),
promptRefKind: snapshot.promptRef.kind,
testCaseLabel:
testCaseLabelMap.get(snapshot.testCaseId.trim()) ||
snapshot.testCaseId.trim(),
description: block.content?.trim() || snapshot.output.trim(),
b64: media.b64,
mimeType: media.mimeType,
});
}
}
if (!resolvedMedia.length) {
throw new EvaluationExecutionError('No valid image evidence could be resolved for evaluation.');
}
return resolvedMedia;
}
private async resolveEvaluationMediaItem(
mediaItem: EvaluationMediaItem
): Promise<{ b64: string; mimeType?: string }> {
const label = mediaItem.label?.trim() || 'image';
const inlineB64 = mediaItem.b64?.trim() || '';
const assetId = mediaItem.assetId?.trim() || '';
if (inlineB64) {
return {
b64: inlineB64,
mimeType: mediaItem.mimeType?.trim() || 'image/png',
};
}View on GitHub (pinned to 3e677b1d9f)
Solutions
- Ensure each image evidence item carries a valid assetId (resolvable in ImageStorageService) or a non-empty b64 string
- Verify referenced assets still exist in image storage (re-upload if purged)
- If your evidence uses URLs, convert/download to b64 or register as stored assets before evaluating
- Log which items were skipped to find the malformed evidence
Example fix
// before
const snapshot = { outputEvidence: [{ url: 'https://cdn/x.png' }] }; // unsupported shape
// after
const snapshot = { outputEvidence: [{ b64: await fetchAsBase64('https://cdn/x.png'), mimeType: 'image/png' }] }; Defensive patterns
Strategy: validation
Validate before calling
const usable = evidence.filter(e => Boolean(e.assetId?.trim() || e.b64?.trim()));
if (!usable.length) throw new Error('No image evidence with assetId/b64; attach or upload images first'); Type guard
const hasResolvableMedia = (items: EvidenceItem[]) => items.some(e => Boolean(e.assetId?.trim() || e.b64?.trim()));
Prevention
- Normalize evidence to {assetId|b64, mimeType} at capture time
- Convert URL-based images to b64 or stored assets before evaluating
When it happens
Trigger: Image-mode result/compare evaluation where every output evidence item lacks both assetId and inline b64 (they get skipped), or resolution of each item yields no media — even though validateRequest's hasSnapshotOutputMedia shape-check may have passed on different items.
Common situations: Evidence items store a URL or file path field the resolver ignores (only assetId/b64 are supported); b64 strings blank after JSON round-trip; asset ids referencing deleted images so items resolve empty; mismatch between which evidence array validation checked and which the resolver reads.
Related errors
- Image result evaluation requires at least one output image e
- Image compare evaluation requires at least two snapshots wit
- Image compare evaluation requires every compared snapshot to
- Evaluation image evidence "${label}" is missing both assetId
- Image understanding service is not available for multimodal
AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27).
Data as JSON: /api/errors/25759dfe133013ee.
Report an issue: GitHub.