{"record":{"id":"f51dfa63d2d5772e","repo":"router-for-me/CLIProxyAPI","slug":"project-id-not-found-in-loadcodeassist-or-onboardu","errorCode":null,"errorMessage":"project id not found in loadCodeAssist or onboardUser response","messagePattern":"project id not found in loadCodeAssist or onboardUser response","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/antigravity/auth.go","lineNumber":280,"sourceCode":"\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\treturn \"\", fmt.Errorf(\"request failed with status %d: %s\", resp.StatusCode, strings.TrimSpace(string(bodyBytes)))\n\t}\n\n\tvar loadResp map[string]any\n\tif errDecode := json.Unmarshal(bodyBytes, &loadResp); errDecode != nil {\n\t\treturn \"\", fmt.Errorf(\"decode response: %w\", errDecode)\n\t}\n\n\tprojectID := extractCloudaicompanionProject(loadResp)\n\n\tif projectID == \"\" {\n\t\tprojectID, err = o.OnboardUser(ctx, accessToken, defaultAntigravityTierID(loadResp))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif projectID == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"project id not found in loadCodeAssist or onboardUser response\")\n\t\t}\n\t\treturn projectID, nil\n\t}\n\n\treturn projectID, nil\n}\n\n// OnboardUser attempts to fetch the project ID via onboardUser by polling for completion\nfunc (o *AntigravityAuth) OnboardUser(ctx context.Context, accessToken, tierID string) (string, error) {\n\tlog.Infof(\"Antigravity: onboarding user with tier: %s\", tierID)\n\tuserAgent := o.nodeUserAgent()\n\trequestBody := map[string]any{\n\t\t\"tier_id\":  tierID,\n\t\t\"metadata\": antigravityControlPlaneMetadata(userAgent),\n\t}\n\n\trawBody, errMarshal := json.Marshal(requestBody)\n\tif errMarshal != nil {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/antigravity/auth.go#L262-L298","documentation":"Returned by AntigravityAuth.FetchProjectID when the loadCodeAssist response contained no project ID (extractCloudaicompanionProject found none of cloudaicompanionProject/projectId/project) AND the follow-up OnboardUser call also returned an empty project ID without erroring. It means Google acknowledged the account but neither the current tier assignment nor onboarding produced a cloudaicompanion project. This is the terminal 'cannot determine project' state for the account.","triggerScenarios":"An Antigravity account that has never been provisioned for code assist and whose onboarding response completes (done=true) without a project; API response-shape changes where Google renames the project field; a brand-new account still propagating entitlements.","commonSituations":"First login on a fresh Google account before Gemini code-assist provisioning finishes; Google changing the v1internal response schema so the three known keys disappear; workspace accounts whose admin disabled project auto-provisioning.","solutions":["Wait a few minutes and re-run login — first-time provisioning is often eventually consistent","Open the Antigravity IDE with the same account once so Google completes provisioning, then re-authenticate the proxy","Upgrade CLIProxyAPI to the latest version in case the extractor keys were updated for a Google schema change","Verify with a personal (non-Workspace) Google account to rule out org policy blocking provisioning"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"projectID, err := auth.FetchProjectID(ctx, token)\nif err != nil && strings.Contains(err.Error(), \"project id not found\") {\n    time.Sleep(5 * time.Minute) // let Google-side provisioning settle\n    projectID, err = auth.FetchProjectID(ctx, token)\n}\nif err != nil { return err }","preventionTips":["Onboard the account once via the official Antigravity IDE before scripting logins","For Workspace accounts, confirm admin policy allows Gemini code assist and project creation","Keep CLIProxyAPI updated so the project-field extractor tracks Google schema changes"],"tags":["antigravity","provisioning","oauth","account"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}