router-for-me/CLIProxyAPI · error

project id not found in loadCodeAssist or onboardUser respon

Error message

project id not found in loadCodeAssist or onboardUser response

What it means

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.

Source

Thrown at internal/auth/antigravity/auth.go:280

	if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {
		return "", fmt.Errorf("request failed with status %d: %s", resp.StatusCode, strings.TrimSpace(string(bodyBytes)))
	}

	var loadResp map[string]any
	if errDecode := json.Unmarshal(bodyBytes, &loadResp); errDecode != nil {
		return "", fmt.Errorf("decode response: %w", errDecode)
	}

	projectID := extractCloudaicompanionProject(loadResp)

	if projectID == "" {
		projectID, err = o.OnboardUser(ctx, accessToken, defaultAntigravityTierID(loadResp))
		if err != nil {
			return "", err
		}
		if projectID == "" {
			return "", fmt.Errorf("project id not found in loadCodeAssist or onboardUser response")
		}
		return projectID, nil
	}

	return projectID, nil
}

// OnboardUser attempts to fetch the project ID via onboardUser by polling for completion
func (o *AntigravityAuth) OnboardUser(ctx context.Context, accessToken, tierID string) (string, error) {
	log.Infof("Antigravity: onboarding user with tier: %s", tierID)
	userAgent := o.nodeUserAgent()
	requestBody := map[string]any{
		"tier_id":  tierID,
		"metadata": antigravityControlPlaneMetadata(userAgent),
	}

	rawBody, errMarshal := json.Marshal(requestBody)
	if errMarshal != nil {

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Wait a few minutes and re-run login — first-time provisioning is often eventually consistent
  2. Open the Antigravity IDE with the same account once so Google completes provisioning, then re-authenticate the proxy
  3. Upgrade CLIProxyAPI to the latest version in case the extractor keys were updated for a Google schema change
  4. Verify with a personal (non-Workspace) Google account to rule out org policy blocking provisioning
Defensive patterns

Strategy: retry

Try / catch

projectID, err := auth.FetchProjectID(ctx, token)
if err != nil && strings.Contains(err.Error(), "project id not found") {
    time.Sleep(5 * time.Minute) // let Google-side provisioning settle
    projectID, err = auth.FetchProjectID(ctx, token)
}
if err != nil { return err }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15). Data as JSON: /api/errors/f51dfa63d2d5772e. Report an issue: GitHub.