decolua/9router · error · Error

No cloudaicompanionProject found in response

Error message

No cloudaicompanionProject found in response

What it means

Thrown by AntigravityService.fetchProjectId when the loadCodeAssist API responded successfully but its payload contained no usable cloudaicompanionProject field (checked as a string or an {id} object after normalization in loadCodeAssist). This legacy method is a strict wrapper: a successful HTTP response without a project ID is still an error.

Source

Thrown at src/lib/oauth/services/antigravity.js:188

          }
        }
        return { success: true, projectId: finalProjectId };
      }

      // Wait 5 seconds before retry
      await new Promise(resolve => setTimeout(resolve, 5000));
    }

    throw new Error("Onboarding timeout - please try again");
  }

  /**
   * Fetch Project ID from loadCodeAssist API (legacy method for compatibility)
   */
  async fetchProjectId(accessToken) {
    const { projectId } = await this.loadCodeAssist(accessToken);
    if (!projectId) {
      throw new Error("No cloudaicompanionProject found in response");
    }
    return projectId;
  }

  /**
   * Save Antigravity tokens to server
   */
  async saveTokens(tokens, userInfo, projectId) {
    const { server, token, userId } = getServerCredentials();

    const response = await fetch(`${server}/api/cli/providers/antigravity`, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${token}`,
        "X-User-Id": userId,
      },
      body: JSON.stringify({

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Call the full loadCodeAssist() and inspect its `raw` payload to see what Google actually returned
  2. Complete the modern onboarding path (completeOnboarding) instead — it can return a newly created project ID even when loadCodeAssist has none yet
  3. Confirm the Google account actually has Gemini Code Assist enabled on some project
  4. Check for a library update: if Google renamed/moved the field, loadCodeAssist's extraction logic needs updating

Example fix

// before
const { projectId } = await this.loadCodeAssist(accessToken);
if (!projectId) {
  throw new Error("No cloudaicompanionProject found in response");
}
// after: fall back to onboarding to create a project
let { projectId } = await this.loadCodeAssist(accessToken);
if (!projectId) {
  ({ projectId } = await this.completeOnboarding(accessToken, undefined, "legacy-tier"));
}
Defensive patterns

Strategy: type-guard

Validate before calling

const { projectId, raw } = await service.loadCodeAssist(token);
if (!projectId) throw new Error(`loadCodeAssist returned no project. Keys: ${Object.keys(raw).join(',')}`);

Type guard

function hasCloudProject(data) { return data && (typeof data.cloudaicompanionProject === 'string' || (data.cloudaicompanionProject && typeof data.cloudaicompanionProject.id === 'string')); }

Try / catch

try {
  const pid = await service.fetchProjectId(token);
} catch (e) {
  if (e.message.includes('cloudaicompanionProject')) {
    // fall back to the onboarding path which can create a project
  } else throw e;
}

Prevention

When it happens

Trigger: loadCodeAssist returns 200 with a body lacking cloudaicompanionProject — typically when the authenticated Google account has never been provisioned a Code Assist project, or the response shape changed (field nested elsewhere / renamed).

Common situations: Google accounts that have never used Gemini Code Assist; GCP org accounts where the companion project lives in a different org unit; upstream API contract changes between library and Google versions.

Related errors


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/ea14b3d61cd8b11b. Report an issue: GitHub.