{"record":{"id":"92a9a24764bc778e","repo":"sipeed/picoclaw","slug":"login-failed-w","errorCode":null,"errorMessage":"login failed: %w","messagePattern":"login failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/auth/helpers.go","lineNumber":50,"sourceCode":"\tdefault:\n\t\treturn fmt.Errorf(\"unsupported provider: %s (%s)\", provider, supportedProvidersMsg)\n\t}\n}\n\nfunc authLoginOpenAI(useDeviceCode bool, noBrowser bool) error {\n\tcfg := auth.OpenAIOAuthConfig()\n\n\tvar cred *auth.AuthCredential\n\tvar err error\n\n\tif useDeviceCode {\n\t\tcred, err = auth.LoginDeviceCode(cfg)\n\t} else {\n\t\tcred, err = auth.LoginBrowserWithOptions(cfg, auth.LoginBrowserOptions{NoBrowser: noBrowser})\n\t}\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"login failed: %w\", err)\n\t}\n\n\tif err = auth.SetCredential(\"openai\", cred); err != nil {\n\t\treturn fmt.Errorf(\"failed to save credentials: %w\", err)\n\t}\n\n\tappCfg, err := internal.LoadConfig()\n\tif err == nil {\n\t\t// Update or add openai in ModelList\n\t\tfoundOpenAI := false\n\t\tfor i := range appCfg.ModelList {\n\t\t\tif isOpenAIModel(appCfg.ModelList[i]) {\n\t\t\t\tappCfg.ModelList[i].AuthMethod = \"oauth\"\n\t\t\t\tfoundOpenAI = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/auth/helpers.go#L32-L68","documentation":"Error \"login failed: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at cmd/picoclaw/internal/auth/helpers.go:50 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"}