linshenkx/prompt-optimizer · error · EvaluationValidationError
Image result evaluation requires at least one output image e
Error message
Image result evaluation requires at least one output image evidence item.
What it means
Thrown when a 'result' evaluation runs in image text-2-image mode (isImageText2ImageMode(request) is true) but the snapshot has no output image evidence (hasSnapshotOutputMedia returns false). Image generation evaluations must include at least one generated output image so the multimodal evaluator has something to score. It is an EvaluationValidationError raised during validateRequest, before execution.
Source
Thrown at packages/core/src/services/evaluation/service.ts:480
}
if (!request.mode.subMode) {
throw new EvaluationValidationError('Sub mode must not be empty.');
}
switch (request.type) {
case 'result':
if (!request.target?.workspacePrompt?.trim()) {
throw new EvaluationValidationError('Workspace prompt must not be empty.');
}
this.validateTestCase(request.testCase, 'Result evaluation test case');
this.validateSnapshot(request.snapshot, 'Result evaluation snapshot');
if (request.snapshot.testCaseId !== request.testCase.id) {
throw new EvaluationValidationError(
'Result evaluation snapshot testCaseId must match testCase.id.'
);
}
if (this.isImageText2ImageMode(request) && !this.hasSnapshotOutputMedia(request.snapshot)) {
throw new EvaluationValidationError(
'Image result evaluation requires at least one output image evidence item.'
);
}
break;
case 'compare':
if (!request.target?.workspacePrompt?.trim()) {
throw new EvaluationValidationError('Workspace prompt must not be empty.');
}
if (!Array.isArray(request.testCases) || request.testCases.length < 1) {
throw new EvaluationValidationError('Compare evaluation requires at least one test case.');
}
if (!Array.isArray(request.snapshots) || request.snapshots.length < 2) {
throw new EvaluationValidationError('Compare evaluation requires at least two snapshots.');
}
const testCaseIds = new Set<string>();
request.testCases.forEach((testCase, index) => {View on GitHub (pinned to 3e677b1d9f)
Solutions
- Attach the generated output image(s) to the snapshot's output evidence (assetId or b64) before evaluating
- If the workflow is text-only, fix the mode.functionMode/subMode so isImageText2ImageMode is false
- Re-run the generation step and re-capture the snapshot so output media is populated
Example fix
// before
const snapshot = { testCaseId: tc.id, outputEvidence: [] };
await svc.evaluate({ type: 'result', testCase: tc, snapshot, ... });
// after
const snapshot = {
testCaseId: tc.id,
outputEvidence: [{ assetId: generatedImageId, mimeType: 'image/png' }],
};
await svc.evaluate({ type: 'result', testCase: tc, snapshot, ... }); Defensive patterns
Strategy: validation
Validate before calling
const hasOutputImage = (snap: EvaluationSnapshot) =>
(snap.outputEvidence ?? []).some(e => Boolean(e.assetId || e.b64));
if (isImageMode(mode) && !hasOutputImage(snapshot)) {
throw new Error('Capture the generated image before evaluating');
}
await svc.evaluate(req); Type guard
const hasSnapshotOutputMedia = (s: EvaluationSnapshot): boolean => (s.outputEvidence ?? []).some(e => Boolean(e.assetId?.trim() || e.b64?.trim()));
Prevention
- Capture snapshots only after image generation completes
- Verify mode/subMode actually intend image evaluation
When it happens
Trigger: evaluate({type:'result', mode: <image text-2-image mode>, snapshot}) where the snapshot's output evidence items contain no image media (no assetId/b64 image outputs).
Common situations: Snapshot was taken before the image generation step finished; the workspace run produced text-only output; evidence media was stripped when serializing/deserializing the snapshot; wrong subMode configured causing image mode to be selected for a text workflow.
Related errors
- Image compare evaluation requires at least two snapshots wit
- Image compare evaluation requires every compared snapshot to
- No valid image evidence could be resolved for evaluation.
- Evaluation image evidence "${label}" is missing both assetId
- Result evaluation snapshot testCaseId must match testCase.id
AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27).
Data as JSON: /api/errors/7dcb04571b6e3430.
Report an issue: GitHub.