diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index cf799140d..f51b72173 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -13,7 +13,7 @@ func DefaultConfig() *Config { Workspace: "~/.picoclaw/workspace", RestrictToWorkspace: true, Provider: "", - Model: "glm-4.7", + Model: "", // Require explicit model specification MaxTokens: 8192, Temperature: nil, // nil means use provider default MaxToolIterations: 20, diff --git a/pkg/providers/legacy_provider.go b/pkg/providers/legacy_provider.go index 23f137538..b40dbeb6a 100644 --- a/pkg/providers/legacy_provider.go +++ b/pkg/providers/legacy_provider.go @@ -28,6 +28,15 @@ func CreateProvider(cfg *config.Config) (LLMProvider, string, error) { return nil, "", fmt.Errorf("no providers configured. Please add entries to model_list in your config") } + // If no model is specified, use the first model from model_list + if model == "" { + if len(cfg.ModelList) > 0 { + model = cfg.ModelList[0].ModelName + } else { + return nil, "", fmt.Errorf("no model specified and no models in model_list. Please set model_name in agents.defaults or add models to model_list") + } + } + // Get model config from model_list modelCfg, err := cfg.GetModelConfig(model) if err != nil {