jackwener/OpenCLI · error · CommandExecutionError

MiniMax music reported completion without data.audio

Error message

MiniMax music reported completion without data.audio

What it means

Status 2 means MiniMax says the music generation completed, but the completed payload must contain data.audio — either a hex-encoded audio payload or, elsewhere in this flow, a URL. If data.audio is missing or an empty/whitespace string, the claimed completion is unusable, so the client throws instead of writing an empty file.

Source

Thrown at clis/minimax/utils.js:116

    }
    const data = payload.data;
    if (!data || typeof data !== 'object' || Array.isArray(data) || !Number.isInteger(data.status)) {
        throw new CommandExecutionError('MiniMax music response is missing integer data.status');
    }
    if (data.status === 1) {
        const traceId = typeof payload.trace_id === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(payload.trace_id.trim())
            ? payload.trace_id.trim()
            : '';
        throw new CommandExecutionError(
            `MiniMax music returned status 1 (in progress) without a resumable task id${traceId ? ` (trace_id: ${traceId})` : ''}`,
            'Do not resubmit blindly: this endpoint exposes no query command, so check MiniMax account history first.',
        );
    }
    if (data.status !== 2) {
        throw new CommandExecutionError(`MiniMax music returned unknown data.status ${data.status}`);
    }
    if (typeof data.audio !== 'string' || !data.audio.trim()) {
        throw new CommandExecutionError('MiniMax music reported completion without data.audio');
    }
    return {
        audio: data.audio.trim(),
        expectedBytes: payload.extra_info == null ? null : parseExpectedSize(payload.extra_info),
    };
}

function parseExpectedSize(extraInfo) {
    if (!extraInfo || typeof extraInfo !== 'object' || Array.isArray(extraInfo)) {
        throw new CommandExecutionError('MiniMax music returned malformed extra_info');
    }
    if (extraInfo.music_size == null) return null;
    if (!Number.isSafeInteger(extraInfo.music_size) || extraInfo.music_size <= 0) {
        throw new CommandExecutionError('MiniMax music returned invalid extra_info.music_size');
    }
    return extraInfo.music_size;
}

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Dump the raw response to confirm whether data.audio is truly missing vs an empty string
  2. Retry the generation once; if reproducible, capture trace_id and report to MiniMax support
  3. Verify you are on the current MiniMax music endpoint version (field may have been renamed)
  4. If audio arrives as a URL instead of hex, route the response through the URL-based path instead of the hex decoder

Example fix

// before: assuming audio always present on status 2
const { audio } = parseCompletedMusic(body);
// after
const parsed = parseCompletedMusic(body);
if (!parsed?.audio) { /* fall back to re-query or resubmit */ }
Defensive patterns

Strategy: validation

Validate before calling

function completedAudioPresent(data) {
  return data?.status === 2 && typeof data.audio === 'string' && data.audio.trim().length > 0;
}
if (!completedAudioPresent(payload?.data)) {
  // retry or inspect raw payload before calling the parser
}

Type guard

function hasAudioPayload(data) {
  return typeof data === 'object' && data !== null &&
    typeof data.audio === 'string' && data.audio.trim() !== '';
}

Try / catch

try {
  const result = parseCompletedMusic(payload);
} catch (e) {
  if (/without data\.audio/.test(e.message)) {
    console.error('Completed job had no audio; retry once and keep trace info');
    // trigger one retry
  } else throw e;
}

Prevention

When it happens

Trigger: MiniMax returns status 2 with data.audio absent, null, or ""; response truncated by a proxy; a schema change renamed the audio field; a partially-finished job marked complete.

Common situations: Transient MiniMax server bug marking jobs complete without payload; intermediary CDN/gateway truncating large hex payloads; using an outdated endpoint whose completed responses omit audio (URL delivered elsewhere).

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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