nexu-io/open-design · error · Error
Vela image ${command} returned unexpected kind ${kind ?? 'mi
Error message
Vela image ${command} returned unexpected kind ${kind ?? 'missing'} What it means
Thrown after the ready-status check when asset.kind is not the string 'image'. The daemon called an image gen/edit command and expects kind === 'image'; a different kind (e.g. 'video', 'audio') indicates a routing or schema problem. The actual kind (or 'missing') is shown.
Source
Thrown at apps/daemon/src/media/vela.ts:395
'--output',
outputPath,
'--json',
];
const stdout = await runCommand(args, {
...velaWorkspaceCommandOptions(input.workspaceId),
timeoutMs: VELA_IMAGE_TIMEOUT_MS,
});
const asset = parseJsonObject(stdout, `image ${command}`);
const assetId = nonEmptyString(asset.asset_id);
const status = nonEmptyString(asset.status);
const kind = nonEmptyString(asset.kind);
const mime = nonEmptyString(asset.mime_type);
if (!assetId) throw new Error(`Vela image ${command} response is missing asset_id`);
if (status !== 'ready') {
throw new Error(`Vela image ${command} returned non-ready asset status ${status ?? 'missing'}`);
}
if (kind !== 'image') {
throw new Error(`Vela image ${command} returned unexpected kind ${kind ?? 'missing'}`);
}
if (!mime?.startsWith('image/')) {
throw new Error(`Vela image ${command} returned invalid mime_type ${mime ?? 'missing'}`);
}
const bytes = await readNonEmptyOutput(outputPath, `image ${command}`);
return {
bytes,
// The tier is part of what the user was charged for, so name it when it
// was chosen and say so plainly when the server's default decided.
providerNote: `vela/${wireModel} · ${
profile ? `${profile.aspectRatio} ${profile.resolution}` : 'model default profile'
} · ${requestedQuality ?? 'model default quality'} · ${bytes.length} bytes`,
suggestedExt: extensionForImageMime(mime),
};
} finally {
await rm(tempDir, { recursive: true, force: true });
}
}View on GitHub (pinned to 5be4028344)
Solutions
- Run the Vela image command directly and inspect the kind field in the response
- Confirm the model id routes to image generation, not video/audio
- Check the Vela CLI version for a kind-field schema change
- Update the parser if Vela renamed or restructured the kind field
Defensive patterns
Strategy: type-guard
Validate before calling
function assetIsImageKind(asset: Record<string, unknown>): boolean {
return asset.kind === 'image';
} Type guard
function isImageAsset(asset: unknown): asset is { kind: 'image' } {
return typeof asset === 'object' && asset !== null
&& (asset as { kind?: unknown }).kind === 'image';
} Try / catch
try {
if (!isImageAsset(asset)) throw new Error(`unexpected kind: ${asset.kind ?? 'missing'}`);
} catch (err) {
// verify the model id routes to image generation; rethrow otherwise
} Prevention
- Confirm the model id routes to image generation before calling renderVelaImage
- Pin the Vela CLI version so the kind field schema is stable
- Capture the full response on a kind mismatch to diagnose routing or schema changes
When it happens
Trigger: Vela image gen/edit JSON has a kind field that is not 'image' — for example the endpoint returned a video/audio asset, or the field is missing/renamed.
Common situations: Wrong CLI subcommand was routed but parsed as image; Vela renamed the kind field; a model rollout returned a different asset type; cross-kind response from a misconfigured model id.
Related errors
- Vela image ${command} response is missing asset_id
- Vela image ${command} returned non-ready asset status ${stat
- Vela image ${command} returned invalid mime_type ${mime ?? '
- Vela ${command} returned no JSON output
- Vela ${command} returned invalid JSON: ${detail}
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/3a10f6e5d3435b22.
Report an issue: GitHub.