{"record":{"id":"cf9bc2242eaeab3d","repo":"sipeed/picoclaw","slug":"error-loading-config-w","errorCode":null,"errorMessage":"error loading config: %w","messagePattern":"error loading config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/agent/helpers.go","lineNumber":28,"sourceCode":"\t\"strings\"\n\n\t\"github.com/ergochat/readline\"\n\n\t\"github.com/sipeed/picoclaw/cmd/picoclaw/internal\"\n\t\"github.com/sipeed/picoclaw/pkg/agent\"\n\t\"github.com/sipeed/picoclaw/pkg/bus\"\n\t\"github.com/sipeed/picoclaw/pkg/logger\"\n\t\"github.com/sipeed/picoclaw/pkg/providers\"\n)\n\nfunc agentCmd(message, sessionKey, model string, debug bool) error {\n\tif sessionKey == \"\" {\n\t\tsessionKey = \"cli:default\"\n\t}\n\n\tcfg, err := internal.LoadConfig()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error loading config: %w\", err)\n\t}\n\n\tlogger.ConfigureFromEnv()\n\n\tif debug {\n\t\tlogger.SetLevel(logger.DEBUG)\n\t\tfmt.Println(\"🔍 Debug mode enabled\")\n\t}\n\n\tif model != \"\" {\n\t\tcfg.Agents.Defaults.ModelName = model\n\t}\n\n\tprovider, modelID, err := providers.CreateProvider(cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating provider: %w\", err)\n\t}\n","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/agent/helpers.go#L10-L46","documentation":"Error \"error loading config: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at cmd/picoclaw/internal/agent/helpers.go:28 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"}