jackwener/OpenCLI · warning · ArgumentError

Refusing to spend MiniMax quota without --execute

Error message

Refusing to spend MiniMax quota without --execute

What it means

Music generation consumes paid MiniMax quota, so the CLI is dry-run by default: it performs all validation and then refuses to call the API unless --execute (parsed via boolean()) is true. Without it, the CLI throws this ArgumentError as a cost guard.

Source

Thrown at clis/minimax/music.js:118

        const lyrics = text(kwargs.lyrics, 3500, '--lyrics');

        if (instrumental && (!prompt || lyrics || lyricsOptimizer)) {
            throw new ArgumentError('minimax music --instrumental requires prompt and cannot be combined with --lyrics or --lyrics-optimizer');
        }
        if (lyricsOptimizer && (!prompt || lyrics)) {
            throw new ArgumentError('minimax music --lyrics-optimizer requires prompt and cannot be combined with --lyrics');
        }
        if (!instrumental && !lyrics && !lyricsOptimizer) {
            throw new ArgumentError('minimax music vocal generation requires --lyrics, or prompt with --lyrics-optimizer');
        }
        if (aigcWatermark && regionKey !== 'cn') {
            throw new ArgumentError('minimax music --aigc-watermark is only supported with --region cn');
        }
        if (kwargs.op != null && outputFormat !== 'hex') {
            throw new ArgumentError('minimax music --op requires --output-format hex');
        }
        const outputDir = outputFormat === 'hex' ? resolveOutputDir(kwargs.op) : null;
        if (!execute) throw new ArgumentError('Refusing to spend MiniMax quota without --execute');

        const region = MUSIC_REGIONS[regionKey];
        const apiKey = requireApiKey();
        const reservation = outputFormat === 'hex' ? reserveAudioFile(outputDir, model, audioFormat) : null;
        let committed = false;
        try {
            const payload = await generateMusic(region, apiKey, buildRequest({
                model, prompt, lyrics, outputFormat, audioFormat, sampleRate, bitrate,
                instrumental, lyricsOptimizer, aigcWatermark,
            }), timeoutSeconds);
            const completed = parseCompletedMusic(payload, region);
            let audioUrl = null;
            let file = null;
            if (outputFormat === 'url') {
                audioUrl = requireAudioUrl(completed.audio);
            } else {
                file = commitAudioFile(reservation, decodeAudioHex(completed.audio, completed.expectedBytes, audioFormat));
                committed = true;

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Add --execute true (or --execute 1) once you've verified the dry-run output and accept the quota cost
  2. If you intended a dry run, this error is expected behavior — treat it as confirmation nothing was charged
  3. Ensure wrapper scripts forward the EXECUTE variable instead of dropping it
  4. Keep a two-step workflow: run without --execute to preview, then rerun with --execute true

Example fix

// before
minimax music --lyrics "..." --prompt "..."
// after
minimax music --lyrics "..." --prompt "..." --execute true
Defensive patterns

Strategy: validation

Validate before calling

if (!parseBoolFlag(opts.execute)) {
  console.warn('Dry run: nothing will be generated. Add --execute true to spend MiniMax quota.');
}

Try / catch

try {
  runMinimaxMusic(args);
} catch (e) {
  if (e.message.includes('Refusing to spend MiniMax quota')) {
    console.error('Dry run completed with no errors. Re-run with --execute true to generate.');
    process.exitCode = 0; // treat as expected for dry runs
  } else throw e;
}

Prevention

When it happens

Trigger: Running the command fully valid but without --execute; --execute false or --execute 0; an unset/empty EXECUTE variable in a wrapper resolving to false.

Common situations: Testing invocations to check validation and being surprised the API wasn't called; CI jobs where the execute flag was omitted for safety; users migrating from other CLIs that execute by default.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/0c559295ce460252. Report an issue: GitHub.