{"record":{"id":"f308f6fe6a4f5d4d","repo":"router-for-me/CLIProxyAPI","slug":"no-project-id-in-response","errorCode":null,"errorMessage":"no project_id in response","messagePattern":"no project_id in response","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/antigravity/auth.go","lineNumber":358,"sourceCode":"\n\t\tif resp.StatusCode == http.StatusOK {\n\t\t\tvar data map[string]any\n\t\t\tif errDecode := json.Unmarshal(bodyBytes, &data); errDecode != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"decode response: %w\", errDecode)\n\t\t\t}\n\n\t\t\tif done, okDone := data[\"done\"].(bool); okDone && done {\n\t\t\t\tprojectID := \"\"\n\t\t\t\tif responseData, okResp := data[\"response\"].(map[string]any); okResp {\n\t\t\t\t\tprojectID = extractCloudaicompanionProject(responseData)\n\t\t\t\t}\n\n\t\t\t\tif projectID != \"\" {\n\t\t\t\t\tlog.Infof(\"Successfully fetched project_id: %s\", util.HideAPIKey(projectID))\n\t\t\t\t\treturn projectID, nil\n\t\t\t\t}\n\n\t\t\t\treturn \"\", fmt.Errorf(\"no project_id in response\")\n\t\t\t}\n\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tresponsePreview := strings.TrimSpace(string(bodyBytes))\n\t\tif len(responsePreview) > 500 {\n\t\t\tresponsePreview = responsePreview[:500]\n\t\t}\n\n\t\tresponseErr := responsePreview\n\t\tif len(responseErr) > 200 {\n\t\t\tresponseErr = responseErr[:200]\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"http %d: %s\", resp.StatusCode, responseErr)\n\t}\n","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/antigravity/auth.go#L340-L376","documentation":"Returned by AntigravityAuth.OnboardUser when a poll response reports done=true but neither the top-level object nor its 'response' field contains a recognizable project ID (extractCloudaicompanionProject checks cloudaicompanionProject/projectId/project, including nested {id: ...}). Google says onboarding finished, yet no cloudaicompanion project was assigned. Unlike the not-done case (which sleeps 2s and retries), done=true is terminal, so the function gives up immediately.","triggerScenarios":"Google completing onboarding without creating/attaching a project (org policy, quota, or account-type restriction); a schema change where the project field moves outside the three known keys.","commonSituations":"Google Workspace accounts where project creation is admin-blocked; accounts in a region without code-assist availability; CLIProxyAPI version lagging a Google response-shape change.","solutions":["Retry the login after a few minutes — provisioning races can produce done-without-project transiently","Confirm the account with the Antigravity/Gemini IDE directly to verify onboarding can complete at all","Upgrade CLIProxyAPI in case extractCloudaicompanionProject learned new field names","For Workspace accounts, ask the admin to allow Gemini code assist / project creation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := auth.OnboardUser(ctx, token, tierID); err != nil && strings.Contains(err.Error(), \"no project_id\") {\n    time.Sleep(2 * time.Minute) // provisioning race; retry login\n    _, err = auth.FetchProjectID(ctx, token)\n    if err != nil { return err }\n}","preventionTips":["Complete onboarding in the official IDE once before scripting logins","Verify Workspace org policy permits project creation for the account","Upgrade CLIProxyAPI when Google changes response schemas"],"tags":["antigravity","provisioning","onboarding","account"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}