{"record":{"id":"53e9451c57405cba","repo":"jackwener/OpenCLI","slug":"minimax-music-aigc-watermark-is-only-supported-w","errorCode":null,"errorMessage":"minimax music --aigc-watermark is only supported with --region cn","messagePattern":"minimax music --aigc-watermark is only supported with --region cn","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"clis/minimax/music.js","lineNumber":112,"sourceCode":"        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 {\n            const payload = await generateMusic(region, apiKey, buildRequest({\n                model, prompt, lyrics, outputFormat, audioFormat, sampleRate, bitrate,\n                instrumental, lyricsOptimizer, aigcWatermark,\n            }), timeoutSeconds);\n            const completed = parseCompletedMusic(payload, region);\n            let audioUrl = null;","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/minimax/music.js#L94-L130","documentation":"The AIGC watermark feature is only offered on MiniMax's China endpoint. If --aigc-watermark is true while the resolved region (--region) is not 'cn', the CLI throws this ArgumentError to prevent calling an international endpoint with an unsupported parameter.","triggerScenarios":"--aigc-watermark true with the default (non-cn) region or --region set to anything other than cn (e.g. 'global'/'us'); a config file enabling the watermark globally for all jobs.","commonSituations":"Scripts shared between CN and international teams with the watermark flag baked in; users unaware watermark is region-gated; a default region changed in config while the flag stayed on.","solutions":["Add --region cn to the invocation, or","Remove --aigc-watermark if you must use a non-CN region","Gate the flag in your wrapper: only pass --aigc-watermark when region is cn","Check MUSIC_REGIONS in clis/minimax/music.js for the exact region keys supported"],"exampleFix":"// before\nminimax music --lyrics \"...\" --aigc-watermark true\n// after\nminimax music --lyrics \"...\" --aigc-watermark true --region cn","handlingStrategy":"validation","validationCode":"if (opts.aigcWatermark && opts.region !== 'cn') {\n  throw new Error('--aigc-watermark requires --region cn');\n} // run before invoking the CLI","typeGuard":null,"tryCatchPattern":"try {\n  runMinimaxMusic(args);\n} catch (e) {\n  if (e.message.includes('--aigc-watermark is only supported')) {\n    console.error('Either add --region cn or drop --aigc-watermark for non-CN endpoints');\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Gate the watermark flag on region in wrapper scripts instead of hardcoding it","Document that AIGC watermark is CN-endpoint-only for your team","Re-check defaults whenever the shared region config changes","List supported region keys from MUSIC_REGIONS in clis/minimax/music.js"],"tags":["cli","minimax","region-restriction","flag-conflict"],"backgroundTag":"unsupported-option-for-region","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}