{"record":{"id":"0412fabfae9bea4b","repo":"sipeed/picoclaw","slug":"model-list-d-w","errorCode":null,"errorMessage":"model_list[%d]: %w","messagePattern":"model_list\\[(.+?)\\]: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/config.go","lineNumber":1755,"sourceCode":"\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}\n\treturn matches\n}\n\n// ValidateModelList validates all ModelConfig entries in the model_list.\n// It checks that each model config is valid.\n// Note: Multiple entries with the same model_name are allowed for load balancing.\nfunc (c *Config) ValidateModelList() error {\n\tfor i := range c.ModelList {\n\t\tif err := c.ModelList[i].Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"model_list[%d]: %w\", i, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *Config) SecurityCopyFrom(path string) error {\n\treturn loadSecurityConfig(c, securityPath(path))\n}\n\n// ResetToDefaults backs up the current config, creates a default config,\n// preserves security credentials from the existing config, and saves it.\nfunc ResetToDefaults(configPath string) error {\n\tif err := MakeBackup(configPath); err != nil {\n\t\treturn fmt.Errorf(\"backup before reset: %w\", err)\n\t}\n\tcfg := DefaultConfig()\n\tcfg.Session.ApplyDmScope()\n\tcfg.Session.DeriveDmScope()","sourceCodeStart":1737,"sourceCodeEnd":1773,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/config/config.go#L1737-L1773","documentation":"Wrapper from Config.ValidateModelList: the model_list entry at the given index failed its own Validate() check (missing name, bad provider settings, invalid parameters). The wrapper preserves the index so the offending array element can be located.","triggerScenarios":"Thrown at pkg/config/config.go:1755 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open config.json and inspect the model_list entry at the reported index","Fix the field flagged by the wrapped inner error (name, provider, api key, base URL...)","Re-validate after editing; duplicate model_name entries are allowed for load balancing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}