Problem
The google-vertex provider fails to authenticate using Google Cloud Application Default Credentials (ADC) on Windows, despite:
- Valid gcloud ADC credentials
GOOGLE_APPLICATION_CREDENTIALS environment variable correctly set
gcloud auth application-default print-access-token working correctly
- Vertex AI API enabled in GCP project
Environment
- OpenClaw Version: 2026.2.6-3 (85ed6c7)
- OS: Windows 11
- Node.js Version: v24.13.0
- Google Cloud Project: CWR001
- Google Cloud SDK: Installed and authenticated
Steps to Reproduce
- Set up Google Cloud authentication:
gcloud auth application-default login
gcloud config set project CWR001
- Verify ADC is working:
# This returns a valid access token
gcloud auth application-default print-access-token
# Verify environment variable
$env:GOOGLE_APPLICATION_CREDENTIALS
# Output: C:\Users\User\AppData\Roaming\gcloud\application_default_credentials.json
# Verify credentials file exists
Test-Path $env:GOOGLE_APPLICATION_CREDENTIALS
# Output: True
- Verify Vertex AI API is enabled:
gcloud services list --enabled --filter="name:aiplatform.googleapis.com"
# Output: aiplatform.googleapis.com Vertex AI API
- Configure OpenClaw with google-vertex provider:
Set in ~/.openclaw/openclaw.json:
{
"agents": {
"defaults": {
"model": {
"primary": "google-vertex/gemini-1.5-pro"
}
}
}
}
- Try various auth-profiles.json configurations:
All of these failed:
Attempt 1 - No auth profile:
# Deleted auth-profiles.json entirely
Attempt 2 - OAuth type:
{
"google-vertex:default": {
"type": "oauth",
"provider": "google-vertex"
}
}
Attempt 3 - With profiles wrapper:
{
"profiles": {
"google-vertex:default": {
"provider": "google-vertex",
"mode": "adc"
}
}
}
Attempt 4 - Explicit file path:
{
"profiles": {
"google-vertex:default": {
"provider": "google-vertex",
"mode": "file",
"credentials": "C:\\Users\\User\\AppData\\Roaming\\gcloud\\application_default_credentials.json",
"project": "CWR001",
"location": "us-central1"
}
}
}
- Attempt to use OpenClaw:
openclaw agent --agent main --message "Hello test"
Expected Behavior
OpenClaw should:
- Detect the ADC credentials from
GOOGLE_APPLICATION_CREDENTIALS environment variable
- Automatically use them for Vertex AI authentication
- Successfully make requests to Vertex AI models
Per the documentation at https://docs.openclaw.ai/concepts/model-providers:
Vertex uses gcloud ADC
Actual Behavior
Error:
FailoverError: No API key found for provider "google-vertex".
Auth store: C:\Users\User\.openclaw\agents\main\agent\auth-profiles.json
(agentDir: C:\Users\User\.openclaw\agents\main\agent).
Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir.
Full error log:
18:56:07 [diagnostic] lane task error: lane=main durationMs=3 error="Error: No API key found for provider "google-vertex". Auth store: C:\Users\User\.openclaw\agents\main\agent\auth-profiles.json (agentDir: C:\Users\User\.openclaw\agents\main\agent). Configure auth for this agent (openclaw agents add <id>) or copy auth-profiles.json from the main agentDir."
Additional Context
Credentials File Contents
gc $env:GOOGLE_APPLICATION_CREDENTIALS | ConvertFrom-Json | Select-Object type, quota_project_id, universe_domain
# Output:
# type quota_project_id universe_domain
# ---- ---------------- ---------------
# authorized_user CWR001 googleapis.com
OpenClaw Models List Output
openclaw models list
# Shows google-vertex models but with Auth: no
Code Analysis
Looking at src/agents/model-auth.ts in the OpenClaw repository, line 262-268:
if (normalized === "google-vertex") {
const envKey = getEnvApiKey(normalized);
if (!envKey) {
return null;
}
return { apiKey: envKey, source: "gcloud adc" };
}
The code calls getEnvApiKey(normalized) which appears to be looking for credentials, but it's returning null despite the environment being properly configured.
Related Issues
Platform-Specific Notes
This appears to be a Windows-specific issue or a cross-platform ADC detection problem:
- gcloud CLI works correctly on Windows
- ADC credentials file exists and is valid
- Environment variable is set correctly
- OpenClaw just doesn't detect/use the credentials
Willingness to Help
Happy to provide:
- Additional debugging information
- Test any proposed fixes
- Contribute to PR if guidance is provided
Environment Details
OpenClaw version
Output: 2026.2.6-3 (85ed6c7)
Node.js version
v24.13.0
Windows version
Platform ServicePack Version VersionString
Win32NT 10.0.26100.0 Microsoft Windows NT 10.0.26100.0
gcloud version
Google Cloud SDK 555.0.0
bq 2.1.27
core 2026.01.30
gcloud-crc32c 1.0.0
gsutil 5.35
Problem
The
google-vertexprovider fails to authenticate using Google Cloud Application Default Credentials (ADC) on Windows, despite:GOOGLE_APPLICATION_CREDENTIALSenvironment variable correctly setgcloud auth application-default print-access-tokenworking correctlyEnvironment
Steps to Reproduce
gcloud auth application-default login gcloud config set project CWR001Set in
~/.openclaw/openclaw.json:{ "agents": { "defaults": { "model": { "primary": "google-vertex/gemini-1.5-pro" } } } }All of these failed:
Attempt 1 - No auth profile:
# Deleted auth-profiles.json entirelyAttempt 2 - OAuth type:
{ "google-vertex:default": { "type": "oauth", "provider": "google-vertex" } }Attempt 3 - With profiles wrapper:
{ "profiles": { "google-vertex:default": { "provider": "google-vertex", "mode": "adc" } } }Attempt 4 - Explicit file path:
{ "profiles": { "google-vertex:default": { "provider": "google-vertex", "mode": "file", "credentials": "C:\\Users\\User\\AppData\\Roaming\\gcloud\\application_default_credentials.json", "project": "CWR001", "location": "us-central1" } } }Expected Behavior
OpenClaw should:
GOOGLE_APPLICATION_CREDENTIALSenvironment variablePer the documentation at https://docs.openclaw.ai/concepts/model-providers:
Actual Behavior
Error:
Full error log:
Additional Context
Credentials File Contents
OpenClaw Models List Output
openclaw models list # Shows google-vertex models but with Auth: noCode Analysis
Looking at
src/agents/model-auth.tsin the OpenClaw repository, line 262-268:The code calls
getEnvApiKey(normalized)which appears to be looking for credentials, but it's returningnulldespite the environment being properly configured.Related Issues
Platform-Specific Notes
This appears to be a Windows-specific issue or a cross-platform ADC detection problem:
Willingness to Help
Happy to provide:
Environment Details
OpenClaw version
Output: 2026.2.6-3 (85ed6c7)
Node.js version
v24.13.0
Windows version
Platform ServicePack Version VersionString
Win32NT 10.0.26100.0 Microsoft Windows NT 10.0.26100.0
gcloud version
Google Cloud SDK 555.0.0
bq 2.1.27
core 2026.01.30
gcloud-crc32c 1.0.0
gsutil 5.35