{"record":{"id":"c53433d088c2c9a8","repo":"sipeed/picoclaw","slug":"model-q-not-found-in-model-list-or-providers","errorCode":null,"errorMessage":"model %q not found in model_list or providers","messagePattern":"model %q not found in model_list or providers","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/config.go","lineNumber":1727,"sourceCode":"\t\treturn path\n\t}\n\tif path[0] == '~' {\n\t\thome, _ := os.UserHomeDir()\n\t\tif len(path) > 1 && path[1] == '/' {\n\t\t\treturn home + path[1:]\n\t\t}\n\t\treturn home\n\t}\n\treturn path\n}\n\n// GetModelConfig returns the ModelConfig for the given model name.\n// If multiple configs exist with the same model_name, it uses round-robin\n// selection for load balancing. Returns an error if the model is not found.\nfunc (c *Config) GetModelConfig(modelName string) (*ModelConfig, error) {\n\tmatches := c.findMatches(modelName)\n\tif len(matches) == 0 {\n\t\treturn nil, fmt.Errorf(\"model %q not found in model_list or providers\", modelName)\n\t}\n\tif len(matches) == 1 {\n\t\treturn matches[0], nil\n\t}\n\n\t// Multiple configs - use round-robin for load balancing\n\tidx := (rrCounter.Add(1) - 1) % uint64(len(matches))\n\treturn matches[idx], nil\n}\n\n// findMatches finds all ModelConfig entries with the given model_name.\nfunc (c *Config) findMatches(modelName string) []*ModelConfig {\n\tvar matches []*ModelConfig\n\tfor i := range c.ModelList {\n\t\tif c.ModelList[i].ModelName == modelName {\n\t\t\tmatches = append(matches, c.ModelList[i])\n\t\t}\n\t}","sourceCodeStart":1709,"sourceCodeEnd":1745,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/config.go#L1709-L1745","documentation":"Error \"model %q not found in model_list or providers\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/config/config.go:1727 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}