{"record":{"id":"bac7610d6e5e0a3a","repo":"sipeed/picoclaw","slug":"failed-to-connect-to-onebot-and-reconnect-is-disab","errorCode":null,"errorMessage":"failed to connect to OneBot and reconnect is disabled","messagePattern":"failed to connect to OneBot and reconnect is disabled","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/onebot/onebot.go","lineNumber":177,"sourceCode":"\t\t\"ws_url\": c.config.WSUrl,\n\t})\n\n\tc.ctx, c.cancel = context.WithCancel(ctx)\n\n\tif err := c.connect(); err != nil {\n\t\tlogger.WarnCF(\"onebot\", \"Initial connection failed, will retry in background\", map[string]any{\n\t\t\t\"error\": err.Error(),\n\t\t})\n\t} else {\n\t\tgo c.listen()\n\t\tc.fetchSelfID()\n\t}\n\n\tif c.config.ReconnectInterval > 0 {\n\t\tgo c.reconnectLoop()\n\t} else {\n\t\tif c.conn == nil {\n\t\t\treturn fmt.Errorf(\"failed to connect to OneBot and reconnect is disabled\")\n\t\t}\n\t}\n\n\tc.SetRunning(true)\n\tlogger.InfoC(\"onebot\", \"OneBot channel started successfully\")\n\n\treturn nil\n}\n\nfunc (c *OneBotChannel) connect() error {\n\tdialer := websocket.DefaultDialer\n\tdialer.HandshakeTimeout = 10 * time.Second\n\n\theader := make(map[string][]string)\n\tif c.config.AccessToken.String() != \"\" {\n\t\theader[\"Authorization\"] = []string{\"Bearer \" + c.config.AccessToken.String()}\n\t}\n","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/onebot/onebot.go#L159-L195","documentation":"Error \"failed to connect to OneBot and reconnect is disabled\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/onebot/onebot.go:177 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"}