can1357/oh-my-pi · error · AIError.OAuthError

${ineligibility.reasonMessage}${validation}

Error message

${ineligibility.reasonMessage}${validation}

What it means

assertFreeTierEligible runs after loadCodeAssist during Antigravity login. If the free tier is not in allowedTiers but appears in ineligibleTiers with a reasonMessage, this provisioning OAuthError surfaces Google's own ineligibility message (plus an optional validation URL appended on a new line). The Google account cannot use the Antigravity free tier, so the login aborts before onboarding.

Source

Thrown at packages/ai/src/registry/oauth/google-antigravity.ts:145

}

function getFreeTierIneligibility(
	payload: LoadCodeAssistResponse,
): { reasonMessage: string; validationUrl: string | undefined } | undefined {
	const tier = payload.ineligibleTiers?.find(candidate => candidate.tierId === FREE_TIER_ID);
	if (!tier?.reasonMessage) return undefined;
	return {
		reasonMessage: tier.reasonMessage,
		validationUrl: tier.validationUrl && tier.validationUrl.length > 0 ? tier.validationUrl : undefined,
	};
}

function assertFreeTierEligible(payload: LoadCodeAssistResponse): void {
	if (isFreeTierAllowed(payload)) return;
	const ineligibility = getFreeTierIneligibility(payload);
	if (!ineligibility) return;
	const validation = ineligibility.validationUrl ? `\n${ineligibility.validationUrl}` : "";
	throw new AIError.OAuthError(`${ineligibility.reasonMessage}${validation}`, {
		kind: "provisioning",
		provider: PROVIDER,
	});
}

async function requestCloudCodeAssist({
	label,
	url,
	method,
	headers,
	body,
	signal,
	timeoutMs,
}: CloudCodeRequest): Promise<unknown> {
	throwIfLoginCancelled(signal);
	const init: RequestInit = body === undefined ? { method, headers } : { method, headers, body };
	const response = await oauthFetch(url, init, { provider: PROVIDER, signal, timeoutMs });
	if (response.status !== 200) {

View on GitHub (pinned to 9690622007)

Solutions

  1. Open the validationUrl printed in the error message and complete whatever Google requires (terms acceptance, identity/billing verification).
  2. Check with your Google Cloud/Workspace administrator that Cloud AI Companion / Gemini Code Assist is enabled for your account.
  3. Verify your account's region is supported for the Antigravity free tier.
  4. Try a different Google account that is eligible for the free tier.
  5. If you believe eligibility is wrong, re-run login after fixing account settings to refresh loadCodeAssist.

Example fix

// The error itself is not a code bug; resolve the account restriction:
// error message example:
// "Free tier is not available for this account.\nhttps://codeassist.google.com/validate"
// after completing validation at the URL, retry:
await loginAntigravity(ctrl); // now passes assertFreeTierEligible
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await loginAntigravity(ctrl);
} catch (err) {
  if (err instanceof AIError.OAuthError && err.provider === "google-antigravity" && !String(err.message).includes("failed to")) {
    // Google's own ineligibility message (+ optional validation URL). Surface it verbatim:
    ui.show_message("Antigravity login blocked", `${err.message}\nOpen the validation URL above to fix eligibility.`);
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: loadCodeAssist returns a payload where allowedTiers lacks the 'free-tier' id and ineligibleTiers contains a 'free-tier' entry with tierId 'free-tier' and a non-empty reasonMessage; assertFreeTierEligible then throws reasonMessage (+ validationUrl).

Common situations: Google Workspace-managed accounts where the admin disabled Cloud Code/Antigravity; accounts already on a paid tier or with billing configs blocking the free tier; region restrictions; accounts flagged by Google requiring additional validation (the validationUrl points to the fix, e.g. accepting terms or verifying identity).

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/3e5f0cea5824ed13. Report an issue: GitHub.