{"record":{"id":"f2977d2319fca043","repo":"musistudio/claude-code-router","slug":"resolution-is-required-for-target-protocol","errorCode":null,"errorMessage":"resolution is required for ${target.protocol}.","messagePattern":"resolution is required for (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/media/service.ts","lineNumber":164,"sourceCode":"    return this.submitAndWait(\"image-edit\", request, modelPlan, optionalString(args.idempotency_key));\n  }\n\n  videoStart(args: Record<string, unknown>, modelInput: MediaModelInput): PublicMediaJob {\n    const modelPlan = this.mediaModelPlan(\"video-generate\", modelInput);\n    const target = resolveProviderMediaTarget(this.requireConfig(), modelPlan.modelSelector, \"video-generate\");\n    const constraints = videoGenerationConstraints(target.protocol);\n    const durationValue = numberValue(args.duration) ?? constraints.defaultDuration;\n    if (durationValue === undefined) throw new Error(`duration is required for ${target.protocol}.`);\n    if (!Number.isInteger(durationValue)) throw new Error(\"duration must be an integer number of seconds.\");\n    if (constraints.durations && !constraints.durations.includes(durationValue)) {\n      throw new Error(`duration must be one of ${constraints.durations.join(\", \")} seconds for ${target.protocol}.`);\n    }\n    if (constraints.durationMinimum !== undefined && constraints.durationMaximum !== undefined &&\n      (durationValue < constraints.durationMinimum || durationValue > constraints.durationMaximum)) {\n      throw new Error(`duration must be between ${constraints.durationMinimum} and ${constraints.durationMaximum} seconds for ${target.protocol}.`);\n    }\n    const resolution = optionalString(args.resolution) ?? constraints.defaultResolution;\n    if (!resolution) throw new Error(`resolution is required for ${target.protocol}.`);\n    if (!constraints.resolutions.includes(resolution)) {\n      throw new Error(`resolution must be one of ${constraints.resolutions.join(\", \")} for ${target.protocol}.`);\n    }\n    const aspectRatio = optionalString(args.aspect_ratio);\n    if (constraints.requiredParameters.includes(\"aspect_ratio\") && !aspectRatio) {\n      throw new Error(`aspect_ratio is required for ${target.protocol}.`);\n    }\n    if (aspectRatio && !constraints.aspectRatios.includes(aspectRatio)) {\n      throw new Error(`aspect_ratio must be one of ${constraints.aspectRatios.join(\", \")} for ${target.protocol}.`);\n    }\n    const request: VideoGenerateRequest = {\n      aspectRatio,\n      duration: durationValue,\n      images: args.images === undefined && args.image === undefined ? [] : this.validateImages(args.images ?? args.image, 1, 7),\n      prompt: requiredPrompt(args.prompt),\n      resolution\n    };\n    const job = this.submit(\"video-generate\", request, modelPlan, optionalString(args.idempotency_key));","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/media/service.ts#L146-L182","documentation":"Thrown when no resolution can be determined for video generation: args.resolution is absent and the protocol's constraints define no defaultResolution. Unlike duration/resolution mistakes with wrong values, this is the missing-value case.","triggerScenarios":"Starting video generation on a protocol with no defaultResolution and omitting the resolution argument.","commonSituations":"Provider switch removing the default; minimal args relying on old defaults; resolution passed under a different key name (e.g. res or size).","solutions":["Pass resolution explicitly: videoStart({ resolution: \"720p\", ... })","Check constraints.resolutions (surfaced in error 216's message) for allowed values","Confirm target.protocol matches the provider you configured"],"exampleFix":"// before\nmedia.videoStart({ prompt, duration: 5 }, modelInput);\n\n// after\nmedia.videoStart({ prompt, duration: 5, resolution: \"720p\" }, modelInput);","handlingStrategy":"validation","validationCode":"const c = videoGenerationConstraints(protocol);\nconst resolution = args.resolution ?? c.defaultResolution;\nif (!resolution) throw new Error(`resolution required for ${protocol}`);","typeGuard":"const isValidResolution = (r: unknown): r is string =>\n  typeof r === \"string\" && r.length > 0;","tryCatchPattern":null,"preventionTips":["Always pass resolution explicitly when switching providers","Confirm the resolved protocol before relying on defaults"],"tags":["media","video","validation","resolution"],"backgroundTag":"missing-required-parameter","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}