chenhg5/cc-connect · error
read minimax config: %w
Error message
read minimax config: %w
What it means
LoadMiniMaxLocalConfig wraps a non-ENOENT os.ReadFile failure on the minimax.json file (permission denied, path is a directory, I/O error). A missing file is intentionally tolerated (empty config returned); only real read errors reach this wrapper.
Source
Thrown at config/config.go:412
type MiniMaxLocalConfig struct {
APIKey string `json:"api_key"`
APIHost string `json:"api_host"`
BaseURL string `json:"base_url"`
}
// LoadMiniMaxLocalConfig reads a MiniMax JSON config without exposing secrets.
// It returns an empty config when the file does not exist.
func LoadMiniMaxLocalConfig(dataDir, configFile string) (MiniMaxLocalConfig, error) {
if strings.TrimSpace(configFile) == "" {
configFile = filepath.Join(dataDir, "config", "minimax.json")
}
configFile = expandUserPath(configFile)
data, err := os.ReadFile(configFile)
if err != nil {
if os.IsNotExist(err) {
return MiniMaxLocalConfig{}, nil
}
return MiniMaxLocalConfig{}, fmt.Errorf("read minimax config: %w", err)
}
var cfg MiniMaxLocalConfig
if err := json.Unmarshal(data, &cfg); err != nil {
return MiniMaxLocalConfig{}, fmt.Errorf("parse minimax config: %w", err)
}
return cfg, nil
}
func expandUserPath(path string) string {
// Only the current user's home shorthand is expanded; ~user paths are left
// unchanged to avoid platform-specific user lookup behavior.
if path == "~" {
if home, err := os.UserHomeDir(); err == nil {
return home
}
}
if strings.HasPrefix(path, "~/") {
if home, err := os.UserHomeDir(); err == nil {View on GitHub (pinned to 4000b2338a)
Solutions
- Check permissions/ownership of the minimax.json path
- Verify the configured config file points to a regular readable file
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at config/config.go:412 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/9f11e0ea85ea5928.
Report an issue: GitHub.