{"record":{"id":"ab86c57b953c985c","repo":"chenhg5/cc-connect","slug":"mimo-tts-read-response-w","errorCode":null,"errorMessage":"mimo tts: read response: %w","messagePattern":"mimo tts: read response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/tts.go","lineNumber":490,"sourceCode":"\n\turl := strings.TrimRight(m.BaseURL, \"/\") + \"/chat/completions\"\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(jsonData))\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: create request: %w\", err)\n\t}\n\t// MiMo authenticates via \"api-key\" header, not \"Authorization: Bearer\".\n\treq.Header.Set(\"api-key\", m.APIKey)\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tresp, err := m.Client.Do(req)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts: read response: %w\", err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, \"\", fmt.Errorf(\"mimo tts API %d: %s\", resp.StatusCode, body)\n\t}\n\n\tvar result struct {\n\t\tChoices []struct {\n\t\t\tMessage struct {\n\t\t\t\tAudio struct {\n\t\t\t\t\tData string `json:\"data\"`\n\t\t\t\t} `json:\"audio\"`\n\t\t\t} `json:\"message\"`\n\t\t} `json:\"choices\"`\n\t\tError *struct {\n\t\t\tMessage string `json:\"message\"`\n\t\t\tType    string `json:\"type\"`\n\t\t\tCode    any    `json:\"code\"`\n\t\t} `json:\"error\"`","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/core/tts.go#L472-L508","documentation":"DingTalk downloadAudio: the media-download endpoint returned a non-200 status when fetching the audio file referenced by the message's downloadCode, so the voice bytes are never retrieved and the audio message is dropped.","triggerScenarios":"Thrown at core/tts.go:490 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry synthesis; check network stability/proxy to the MiMo host","Verify BaseURL is reachable and not dropping large responses"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}