router-for-me/CLIProxyAPI · error

no project_id in response

Error message

no project_id in response

What it means

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.

Source

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

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

			if done, okDone := data["done"].(bool); okDone && done {
				projectID := ""
				if responseData, okResp := data["response"].(map[string]any); okResp {
					projectID = extractCloudaicompanionProject(responseData)
				}

				if projectID != "" {
					log.Infof("Successfully fetched project_id: %s", util.HideAPIKey(projectID))
					return projectID, nil
				}

				return "", fmt.Errorf("no project_id in response")
			}

			time.Sleep(2 * time.Second)
			continue
		}

		responsePreview := strings.TrimSpace(string(bodyBytes))
		if len(responsePreview) > 500 {
			responsePreview = responsePreview[:500]
		}

		responseErr := responsePreview
		if len(responseErr) > 200 {
			responseErr = responseErr[:200]
		}
		return "", fmt.Errorf("http %d: %s", resp.StatusCode, responseErr)
	}

View on GitHub (pinned to 78f0c4079e)

Solutions

  1. Retry the login after a few minutes — provisioning races can produce done-without-project transiently
  2. Confirm the account with the Antigravity/Gemini IDE directly to verify onboarding can complete at all
  3. Upgrade CLIProxyAPI in case extractCloudaicompanionProject learned new field names
  4. For Workspace accounts, ask the admin to allow Gemini code assist / project creation
Defensive patterns

Strategy: retry

Try / catch

if _, err := auth.OnboardUser(ctx, token, tierID); err != nil && strings.Contains(err.Error(), "no project_id") {
    time.Sleep(2 * time.Minute) // provisioning race; retry login
    _, err = auth.FetchProjectID(ctx, token)
    if err != nil { return err }
}

Prevention

When it happens

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

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

Related errors


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