nexu-io/open-design · error · Error
model required
Error message
model required
What it means
Thrown by the media dispatch entry point when `model` is missing or empty. A model id (catalog name or arbitrary fal.ai path like "fal-ai/flux/dev") is required to select the renderer. This check runs right after the surface validation.
Source
Thrown at apps/daemon/src/media/index.ts:371
loop,
promptInfluence,
compositionDir,
image,
requestInit,
workspaceId,
onProviderRequestSettled,
} = args;
if (!projectRoot) throw new Error('projectRoot required');
if (!projectsRoot) throw new Error('projectsRoot required');
if (typeof projectId !== 'string' || !projectId) {
throw new Error('projectId required');
}
if (!SURFACES.has(surface)) {
throw new Error(`unsupported surface: ${surface}`);
}
if (typeof model !== 'string' || !model) {
throw new Error('model required');
}
if (surface === 'audio' && audioKind && !AUDIO_KINDS.has(audioKind)) {
throw new Error(
`unsupported audioKind: ${audioKind}. Allowed: music | speech | sfx.`,
);
}
// Arbitrary fal.ai model paths (e.g. "fal-ai/flux/dev") bypass the
// catalog so users can reach any model on fal without waiting for a
// catalog entry. Surface comes from the caller; no cross-surface guard
// is needed because the fal renderer reads ctx.surface directly.
let def = findMediaModel(model);
let isFalCustomPath = false;
let isCatalogBypass = false;
if (!def) {
if (/^fal-ai\//.test(model)) {
isFalCustomPath = true;
def = {
id: model,View on GitHub (pinned to 5be4028344)
Solutions
- Supply a non-empty model id from the media catalog (e.g. "flux-pro") or a fal.ai path (e.g. "fal-ai/flux/dev").
- If unsure which models exist, query the media catalog/registry first.
- Ensure the model field is serialized and not stripped by your client.
- Validate the request payload before dispatch so model is always present.
Example fix
// before
{ surface: "image", prompt: "a cat" }
// after
{ surface: "image", model: "fal-ai/flux/dev", prompt: "a cat" } Defensive patterns
Strategy: validation
Validate before calling
if (typeof model !== 'string' || model.trim() === '') throw new Error('model required'); Type guard
function isNonEmptyModel(v: unknown): v is string {
return typeof v === 'string' && v.trim().length > 0;
} Prevention
- Make model a required field in your tool schema.
- Query the media catalog for valid model ids.
- Serialize requests so the model field is never dropped.
When it happens
Trigger: Omitting the model argument entirely; passing an empty string; passing model as undefined/null/whitespace; relying on a default that does not exist for the chosen surface.
Common situations: Agent forgets the model field; config template with a blank model placeholder; caller assumes a per-surface default but none is set; model field dropped during JSON serialization.
Related errors
- brand: missing required `name`
- brand: `colors` must include at least the background, foregr
- --image path "${rel}" resolves outside the project directory
- --image not found: ${rel}
- --image is not a regular file: ${rel}
AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12).
Data as JSON: /api/errors/694d97db1728b5e2.
Report an issue: GitHub.