{"record":{"id":"8c37cbade2838004","repo":"jackwener/OpenCLI","slug":"minimax-music-lyrics-optimizer-requires-prompt-a","errorCode":null,"errorMessage":"minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics","messagePattern":"minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/minimax/music.js","lineNumber":106,"sourceCode":"        const model = choice(kwargs.model, 'music-3.0', MODELS, '--model');\n        const regionKey = choice(kwargs.region, 'global', Object.keys(MUSIC_REGIONS), '--region');\n        const outputFormat = choice(kwargs['output-format'], 'url', OUTPUT_FORMATS, '--output-format');\n        const audioFormat = choice(kwargs['audio-format'], 'mp3', AUDIO_FORMATS, '--audio-format');\n        const sampleRate = optionalInteger(kwargs['sample-rate'], SAMPLE_RATES, '--sample-rate');\n        const bitrate = optionalInteger(kwargs.bitrate, BITRATES, '--bitrate');\n        const timeoutSeconds = boundedInteger(kwargs.timeout, 600, 1, 1800, '--timeout');\n        const instrumental = boolean(kwargs.instrumental, '--instrumental');\n        const lyricsOptimizer = boolean(kwargs['lyrics-optimizer'], '--lyrics-optimizer');\n        const aigcWatermark = boolean(kwargs['aigc-watermark'], '--aigc-watermark');\n        const execute = boolean(kwargs.execute, '--execute');\n        const prompt = text(kwargs.prompt, 2000, 'prompt');\n        const lyrics = text(kwargs.lyrics, 3500, '--lyrics');\n\n        if (instrumental && (!prompt || lyrics || lyricsOptimizer)) {\n            throw new ArgumentError('minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer');\n        }\n        if (lyricsOptimizer && (!prompt || lyrics)) {\n            throw new ArgumentError('minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics');\n        }\n        if (!instrumental && !lyrics && !lyricsOptimizer) {\n            throw new ArgumentError('minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer');\n        }\n        if (aigcWatermark && regionKey !== 'cn') {\n            throw new ArgumentError('minimax music --aigc-watermark is only supported with --region cn');\n        }\n        if (kwargs.op != null && outputFormat !== 'hex') {\n            throw new ArgumentError('minimax music --op requires --output-format hex');\n        }\n        const outputDir = outputFormat === 'hex' ? resolveOutputDir(kwargs.op) : null;\n        if (!execute) throw new ArgumentError('Refusing to spend MiniMax quota without --execute');\n\n        const region = MUSIC_REGIONS[regionKey];\n        const apiKey = requireApiKey();\n        const reservation = outputFormat === 'hex' ? reserveAudioFile(outputDir, model, audioFormat) : null;\n        let committed = false;\n        try {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/minimax/music.js#L88-L124","documentation":"--lyrics-optimizer asks MiniMax to refine a prompt for vocal generation; it therefore requires a non-empty prompt and cannot be combined with --lyrics (you either provide lyrics directly or let the optimizer build a vocal plan from the prompt, not both). Violating either rule throws this ArgumentError.","triggerScenarios":"--lyrics-optimizer true without --prompt; --lyrics-optimizer true together with --lyrics \"...\"; whitespace-only prompt that fails the !prompt check.","commonSituations":"Scripts that always append --lyrics plus --lyrics-optimizer 'for better results'; users assuming the optimizer takes lyrics as input; empty prompt coming from an unset variable in a wrapper script.","solutions":["Provide --prompt and remove --lyrics when using --lyrics-optimizer","Or drop --lyrics-optimizer and pass --lyrics directly for vocal generation","Ensure the prompt is non-empty after trimming","Update wrapper scripts to choose one vocal path: lyrics OR prompt+optimizer"],"exampleFix":"// before\nminimax music --lyrics-optimizer true --lyrics \"...\" --prompt \"pop song\"\n// after\nminimax music --lyrics-optimizer true --prompt \"upbeat pop song about summer\"","handlingStrategy":"validation","validationCode":"function assertOptimizerMode(o) {\n  if (o.lyricsOptimizer) {\n    if (!o.prompt?.trim()) throw new Error('--lyrics-optimizer requires --prompt');\n    if (o.lyrics) throw new Error('--lyrics-optimizer cannot be combined with --lyrics');\n  }\n}\nassertOptimizerMode(cliOpts); // before invoking","typeGuard":null,"tryCatchPattern":"try {\n  runMinimaxMusic(args);\n} catch (e) {\n  if (e.message.includes('--lyrics-optimizer requires')) {\n    console.error('Pick one vocal path: --lyrics directly, or --prompt + --lyrics-optimizer');\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Don't combine --lyrics with --lyrics-optimizer 'for better results' — they are alternative paths","Ensure the prompt variable is set and non-blank when optimizer mode is on","Build flag arrays from a single mode selector variable in scripts","Preview with a dry run before --execute"],"tags":["cli","minimax","flag-conflict","mutual-exclusion"],"backgroundTag":"conflicting-cli-flags","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}