{"record":{"id":"268b27b060b528cc","repo":"sipeed/picoclaw","slug":"failed-to-remove-credentials-w","errorCode":null,"errorMessage":"failed to remove credentials: %w","messagePattern":"failed to remove credentials: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/auth/helpers.go","lineNumber":336,"sourceCode":"\t\t}\n\t\tif err := config.SaveConfig(internal.GetConfigPath(), appCfg); err != nil {\n\t\t\treturn fmt.Errorf(\"could not update config: %w\", err)\n\t\t}\n\t}\n\n\tfmt.Printf(\"Token saved for %s!\\n\", provider)\n\n\tif appCfg != nil {\n\t\tfmt.Printf(\"Default model set to: %s\\n\", appCfg.Agents.Defaults.GetModelName())\n\t}\n\n\treturn nil\n}\n\nfunc authLogoutCmd(provider string) error {\n\tif provider != \"\" {\n\t\tif err := auth.DeleteCredential(provider); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to remove credentials: %w\", err)\n\t\t}\n\n\t\tappCfg, err := internal.LoadConfig()\n\t\tif err == nil {\n\t\t\t// Clear AuthMethod in ModelList\n\t\t\tfor i := range appCfg.ModelList {\n\t\t\t\tswitch provider {\n\t\t\t\tcase \"openai\":\n\t\t\t\t\tif isOpenAIModel(appCfg.ModelList[i]) {\n\t\t\t\t\t\tappCfg.ModelList[i].AuthMethod = \"\"\n\t\t\t\t\t}\n\t\t\t\tcase \"anthropic\":\n\t\t\t\t\tif isAnthropicModel(appCfg.ModelList[i]) {\n\t\t\t\t\t\tappCfg.ModelList[i].AuthMethod = \"\"\n\t\t\t\t\t}\n\t\t\t\tcase \"google-antigravity\", \"antigravity\":\n\t\t\t\t\tif isAntigravityModel(appCfg.ModelList[i]) {\n\t\t\t\t\t\tappCfg.ModelList[i].AuthMethod = \"\"","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/auth/helpers.go#L318-L354","documentation":"Error \"failed to remove credentials: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at cmd/picoclaw/internal/auth/helpers.go:336 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"}