{"record":{"id":"220dbeda9c76c976","repo":"router-for-me/CLIProxyAPI","slug":"fetch-claude-oauth-profile-response-account-uuid","errorCode":null,"errorMessage":"fetch Claude OAuth profile: response account UUID is empty","messagePattern":"fetch Claude OAuth profile: response account UUID is empty","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/claude/anthropic_auth.go","lineNumber":271,"sourceCode":"\t}\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\treturn nil, fmt.Errorf(\"fetch Claude OAuth %s failed with status %d\", label, resp.StatusCode)\n\t}\n\treturn body, nil\n}\n\n// FetchOAuthProfile retrieves the account identity associated with an OAuth access token.\nfunc (o *ClaudeAuth) FetchOAuthProfile(ctx context.Context, accessToken string) (*OAuthProfile, error) {\n\tbody, errFetch := o.fetchOAuthControlPlaneJSON(ctx, ProfileURL, accessToken, \"profile\")\n\tif errFetch != nil {\n\t\treturn nil, errFetch\n\t}\n\tvar profile OAuthProfile\n\tif errUnmarshal := json.Unmarshal(body, &profile); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"parse Claude OAuth profile response: %w\", errUnmarshal)\n\t}\n\tif strings.TrimSpace(profile.Account.UUID) == \"\" {\n\t\treturn nil, fmt.Errorf(\"fetch Claude OAuth profile: response account UUID is empty\")\n\t}\n\treturn &profile, nil\n}\n\n// FetchOAuthRoles performs the claude_cli roles lookup the native client issues\n// alongside the profile query after a token exchange. Only the request shape is\n// covered by captured evidence, so the payload stays opaque and is returned raw\n// instead of being decoded into a guessed structure.\nfunc (o *ClaudeAuth) FetchOAuthRoles(ctx context.Context, accessToken string) (json.RawMessage, error) {\n\tbody, errFetch := o.fetchOAuthControlPlaneJSON(ctx, RolesURL, accessToken, \"claude_cli roles\")\n\tif errFetch != nil {\n\t\treturn nil, errFetch\n\t}\n\tif !json.Valid(body) {\n\t\treturn nil, fmt.Errorf(\"parse Claude OAuth claude_cli roles response: body is not valid JSON\")\n\t}\n\treturn json.RawMessage(body), nil\n}","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/claude/anthropic_auth.go#L253-L289","documentation":"Error \"fetch Claude OAuth profile: response account UUID is empty\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/auth/claude/anthropic_auth.go:271 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the Claude OAuth login flow so the profile response includes the account UUID.","Verify the access token has the scopes required to read the account profile."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}