log.Printf("[Antigravity] Model not found (%s), retrying with fallback model %s (account: %s)",mappedModel,fallbackModel,account.Name)
logger.LegacyPrintf("service.antigravity_gateway","[Antigravity] Model not found (%s), retrying with fallback model %s (account: %s)",mappedModel,fallbackModel,account.Name)
log.Printf("Account %d: signature retry still failing and looks tool-related, retrying with tool blocks downgraded",account.ID)
logger.LegacyPrintf("service.gateway","Account %d: signature retry still failing and looks tool-related, retrying with tool blocks downgraded",account.ID)
log.Printf("[GeminiOAuth] ERROR: Missing project_id for Code Assist OAuth")
logger.LegacyPrintf("service.gemini_oauth","[GeminiOAuth] ERROR: Missing project_id for Code Assist OAuth")
returnnil,fmt.Errorf("missing project_id for Code Assist OAuth: please fill Project ID (optional field) and regenerate the auth URL, or ensure your Google account has an ACTIVE GCP project")
}
// Prefer auto-detected tier; fall back to user-selected tier.
// 已注册但未返回 cloudaicompanionProject,这在 Google One 用户中较常见:需要用户自行提供 project_id。
log.Printf("[GeminiOAuth] User has tier (%s) but no cloudaicompanionProject, trying Cloud Resource Manager...",registeredTierID)
logger.LegacyPrintf("service.gemini_oauth","[GeminiOAuth] User has tier (%s) but no cloudaicompanionProject, trying Cloud Resource Manager...",registeredTierID)
log.Printf("[GeminiOAuth] Found project from Cloud Resource Manager: %s",fallback)
logger.LegacyPrintf("service.gemini_oauth","[GeminiOAuth] Found project from Cloud Resource Manager: %s",fallback)
returnstrings.TrimSpace(fallback),tierID,nil
}
// No project found - user must provide project_id manually
log.Printf("[GeminiOAuth] No project found from Cloud Resource Manager, user must provide project_id manually")
logger.LegacyPrintf("service.gemini_oauth","[GeminiOAuth] No project found from Cloud Resource Manager, user must provide project_id manually")
return"",tierID,fmt.Errorf("user is registered (tier: %s) but no project_id available. Please provide Project ID manually in the authorization form, or create a project at https://console.cloud.google.com",registeredTierID)