{"record":{"id":"0677b4f6bd01f4d4","repo":"sipeed/picoclaw","slug":"error-creating-provider-w-0677b4","errorCode":null,"errorMessage":"error creating provider: %w","messagePattern":"error creating provider: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/gateway/gateway.go","lineNumber":196,"sourceCode":"\t\tfor _, ln := range listenResult.Listeners {\n\t\t\t_ = ln.Close()\n\t\t}\n\t\treturn fmt.Errorf(\"singleton check failed: %w\", err)\n\t}\n\tdefer pid.RemovePidFile(homePath)\n\tcloseListeners := true\n\tdefer func() {\n\t\tif !closeListeners {\n\t\t\treturn\n\t\t}\n\t\tfor _, ln := range listenResult.Listeners {\n\t\t\t_ = ln.Close()\n\t\t}\n\t}()\n\n\tprovider, modelID, err := createStartupProvider(cfg, allowEmptyStartup)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating provider: %w\", err)\n\t}\n\n\tif modelID != \"\" {\n\t\tcfg.Agents.Defaults.ModelName = modelID\n\t}\n\n\tmsgBus := bus.NewMessageBus()\n\tagentLoop := agent.NewAgentLoop(cfg, msgBus, provider)\n\tmsgBus.SetEventPublisher(agentLoop.RuntimeEventBus())\n\tpublishGatewayEvent(agentLoop, runtimeevents.KindGatewayStart, startedAt, nil)\n\n\tfmt.Println(\"\\n📦 Agent Status:\")\n\tstartupStatus := collectGatewayStartupStatus(agentLoop.GetStartupInfo())\n\tfmt.Printf(\"  • Tools: %d loaded\\n\", startupStatus.toolsCount)\n\tfmt.Printf(\"  • Skills: %d/%d available\\n\", startupStatus.skillsAvailable, startupStatus.skillsTotal)\n\n\tlogger.InfoCF(\"agent\", \"Agent initialized\", startupStatus.logFields)\n","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/gateway/gateway.go#L178-L214","documentation":"Error \"error creating provider: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/gateway/gateway.go:196 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"}