Merge branch 'fix/default-model-should-use-model-list' into dev

# Conflicts:
#	pkg/providers/legacy_provider.go
This commit is contained in:
Vishnuvardhan Reddy 2026-02-26 13:49:21 +00:00
commit 3b66929f7d
2 changed files with 10 additions and 1 deletions

View file

@ -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,

View file

@ -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")
}
}
// Collect models to try: primary first, then fallbacks
modelsToTry := []string{model}
modelsToTry = append(modelsToTry, cfg.Agents.Defaults.ModelFallbacks...)