{"record":{"id":"536499f48870c687","repo":"jackwener/OpenCLI","slug":"minimax-music-reported-completion-without-data-aud","errorCode":null,"errorMessage":"MiniMax music reported completion without data.audio","messagePattern":"MiniMax music reported completion without data\\.audio","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/minimax/utils.js","lineNumber":116,"sourceCode":"    }\n    const data = payload.data;\n    if (!data || typeof data !== 'object' || Array.isArray(data) || !Number.isInteger(data.status)) {\n        throw new CommandExecutionError('MiniMax music response is missing integer data.status');\n    }\n    if (data.status === 1) {\n        const traceId = typeof payload.trace_id === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(payload.trace_id.trim())\n            ? payload.trace_id.trim()\n            : '';\n        throw new CommandExecutionError(\n            `MiniMax music returned status 1 (in progress) without a resumable task id${traceId ? ` (trace_id: ${traceId})` : ''}`,\n            'Do not resubmit blindly: this endpoint exposes no query command, so check MiniMax account history first.',\n        );\n    }\n    if (data.status !== 2) {\n        throw new CommandExecutionError(`MiniMax music returned unknown data.status ${data.status}`);\n    }\n    if (typeof data.audio !== 'string' || !data.audio.trim()) {\n        throw new CommandExecutionError('MiniMax music reported completion without data.audio');\n    }\n    return {\n        audio: data.audio.trim(),\n        expectedBytes: payload.extra_info == null ? null : parseExpectedSize(payload.extra_info),\n    };\n}\n\nfunction parseExpectedSize(extraInfo) {\n    if (!extraInfo || typeof extraInfo !== 'object' || Array.isArray(extraInfo)) {\n        throw new CommandExecutionError('MiniMax music returned malformed extra_info');\n    }\n    if (extraInfo.music_size == null) return null;\n    if (!Number.isSafeInteger(extraInfo.music_size) || extraInfo.music_size <= 0) {\n        throw new CommandExecutionError('MiniMax music returned invalid extra_info.music_size');\n    }\n    return extraInfo.music_size;\n}\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/minimax/utils.js#L98-L134","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Dump the raw response to confirm whether data.audio is truly missing vs an empty string","Retry the generation once; if reproducible, capture trace_id and report to MiniMax support","Verify you are on the current MiniMax music endpoint version (field may have been renamed)","If audio arrives as a URL instead of hex, route the response through the URL-based path instead of the hex decoder"],"exampleFix":"// before: assuming audio always present on status 2\nconst { audio } = parseCompletedMusic(body);\n// after\nconst parsed = parseCompletedMusic(body);\nif (!parsed?.audio) { /* fall back to re-query or resubmit */ }","handlingStrategy":"validation","validationCode":"function completedAudioPresent(data) {\n  return data?.status === 2 && typeof data.audio === 'string' && data.audio.trim().length > 0;\n}\nif (!completedAudioPresent(payload?.data)) {\n  // retry or inspect raw payload before calling the parser\n}","typeGuard":"function hasAudioPayload(data) {\n  return typeof data === 'object' && data !== null &&\n    typeof data.audio === 'string' && data.audio.trim() !== '';\n}","tryCatchPattern":"try {\n  const result = parseCompletedMusic(payload);\n} catch (e) {\n  if (/without data\\.audio/.test(e.message)) {\n    console.error('Completed job had no audio; retry once and keep trace info');\n    // trigger one retry\n  } else throw e;\n}","preventionTips":["Retry once automatically on empty audio payloads; they are often transient","Verify your endpoint version returns audio in the expected field","Check proxies for large-body truncation","Report reproducible empty-audio completions to MiniMax support with trace ids"],"tags":["minimax","music","missing-field","api-response"],"backgroundTag":"schema-validation-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}