plandex-ai/plandex · error
error checking default model settings: %v
Error message
error checking default model settings: %v
What it means
PromptSyncModelsIfNeeded checks the default model settings file via ModelSettingsCheckLocalChanges(DefaultModelSettingsPath) and wraps failures as 'error checking default model settings: %v', meaning that file couldn't be read or validated.
Source
Thrown at app/cli/lib/models_sync.go:37
customModelsPath := GetCustomModelsPath(userId)
customModelsRes, err := CustomModelsCheckLocalChanges(customModelsPath)
if err != nil {
return fmt.Errorf("error checking custom models: %v", err)
}
if customModelsRes.HasLocalChanges {
changes = append(
changes,
fmt.Sprintf("%s → %s", color.New(term.ColorHiCyan, color.Bold).Sprint("Custom models"), customModelsPath))
onApprove = append(onApprove, SyncCustomModels)
}
defaultModelSettingsRes, err := ModelSettingsCheckLocalChanges(DefaultModelSettingsPath)
if err != nil {
return fmt.Errorf("error checking default model settings: %v", err)
}
if defaultModelSettingsRes.HasLocalChanges {
changes = append(
changes,
fmt.Sprintf("%s → %s", color.New(term.ColorHiCyan, color.Bold).Sprint("Default model settings"), DefaultModelSettingsPath))
onApprove = append(onApprove, SyncDefaultModelSettings)
}
planModelSettingsRes, err := ModelSettingsCheckLocalChanges(GetPlanModelSettingsPath(CurrentPlanId))
if err != nil {
return fmt.Errorf("error checking plan model settings: %v", err)
}
if planModelSettingsRes.HasLocalChanges {
changes = append(
changes,View on GitHub (pinned to e2d772072e)
Solutions
- Validate/fix the JSON at DefaultModelSettingsPath
- Reset the default model settings file to a known-good copy
- Check permissions on the file and its directory
- Upgrade or downgrade the CLI so the file version matches the binary
Defensive patterns
Strategy: validation
Validate before calling
if b, err := os.ReadFile(lib.DefaultModelSettingsPath); err == nil {
var v any
if err := json.Unmarshal(b, &v); err != nil {
return fmt.Errorf("default model settings invalid: %w", err)
}
} else if !os.IsNotExist(err) {
return fmt.Errorf("cannot read default model settings: %w", err)
} Try / catch
if err := lib.PromptSyncModelsIfNeeded(); err != nil {
if strings.Contains(err.Error(), "error checking default model settings") {
// restore or reset DefaultModelSettingsPath, then retry
}
return err
} Prevention
- Let the CLI write settings files; avoid manual edits
- Validate JSON after any edit
- Restore defaults after CLI version upgrades
- Check directory permissions when moving HOME
When it happens
Trigger: ModelSettingsCheckLocalChanges errors on DefaultModelSettingsPath — unreadable file, malformed JSON, or schema mismatch while computing local changes.
Common situations: Default model settings edited by hand or by a newer CLI version; file corrupted by an interrupted write; permission issues on the config directory.
Related errors
- error checking custom models: %v
- error checking plan model settings: %v
- error loading accounts: %v
- error getting server models input: %v
- invalid value: %s
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/368088d4b0f343be.
Report an issue: GitHub.