Bug Description
hermes doctor reports a working Google AI Studio / Gemini API key as invalid.
Runtime Gemini chat succeeds with provider gemini, model gemma-4-31b-it, base URL https://generativelanguage.googleapis.com/v1beta, and GOOGLE_API_KEY set. For example, hermes chat -Q -q "Reply with exactly: hermes-ok" --max-turns 3 returns hermes-ok.
However, hermes doctor reports gemini (invalid API key) under API Connectivity.
Steps to Reproduce
- Set a working Google AI Studio key as
GOOGLE_API_KEY.
- Configure:
model.provider = gemini
model.default = gemma-4-31b-it
model.base_url = https://generativelanguage.googleapis.com/v1beta
- Confirm runtime works:
hermes chat -Q -q "Reply with exactly: hermes-ok" --max-turns 3 returns hermes-ok.
- Run
hermes doctor.
- Observe
gemini (invalid API key) under API Connectivity.
Expected Behavior
hermes doctor should report Gemini API connectivity as healthy for a valid Google AI Studio key.
Actual Behavior
hermes doctor reports gemini (invalid API key) and suggests checking GOOGLE_API_KEY, even though runtime Gemini chat works with the same key.
Affected Component
Other
Messaging Platform (if gateway-related)
No response
Debug Report
Not collected yet. Runtime validation and code-level diagnosis are included below.
Operating System
Linux
Python Version
3.11.15
Hermes Version
Config version 23; exact hermes version not captured yet.
Additional Logs / Traceback (optional)
Relevant doctor output:
◆ API Connectivity
Checking gemini API...
✗ gemini (invalid API key)
Root Cause Analysis (optional)
hermes_cli/doctor.py dynamically includes the gemini API-key provider via _build_apikey_providers_list(). The dynamic tuple includes GOOGLE_API_KEY / GEMINI_API_KEY and https://generativelanguage.googleapis.com/v1beta/models.
The API-key health-check loop then uses the generic OpenAI-compatible probe: GET {base}/models with Authorization: Bearer <key>. Google AI Studio Gemini API keys are not OpenAI-compatible bearer tokens; they require Google-style auth such as x-goog-api-key: <key> or ?key=<key> against Gemini endpoints.
Proposed Fix (optional)
Add a Gemini-specific doctor connectivity path that probes GET {base}/models using x-goog-api-key, with default base URL https://generativelanguage.googleapis.com/v1beta and optional GEMINI_BASE_URL override. Also ensure GOOGLE_API_KEY, GEMINI_API_KEY, and GEMINI_BASE_URL are recognized by the .env provider-config detector.
Are you willing to submit a PR for this?
Bug Description
hermes doctorreports a working Google AI Studio / Gemini API key as invalid.Runtime Gemini chat succeeds with provider
gemini, modelgemma-4-31b-it, base URLhttps://generativelanguage.googleapis.com/v1beta, andGOOGLE_API_KEYset. For example,hermes chat -Q -q "Reply with exactly: hermes-ok" --max-turns 3returnshermes-ok.However,
hermes doctorreportsgemini (invalid API key)under API Connectivity.Steps to Reproduce
GOOGLE_API_KEY.model.provider = geminimodel.default = gemma-4-31b-itmodel.base_url = https://generativelanguage.googleapis.com/v1betahermes chat -Q -q "Reply with exactly: hermes-ok" --max-turns 3returnshermes-ok.hermes doctor.gemini (invalid API key)under API Connectivity.Expected Behavior
hermes doctorshould report Gemini API connectivity as healthy for a valid Google AI Studio key.Actual Behavior
hermes doctorreportsgemini (invalid API key)and suggests checkingGOOGLE_API_KEY, even though runtime Gemini chat works with the same key.Affected Component
Other
Messaging Platform (if gateway-related)
No response
Debug Report
Operating System
Linux
Python Version
3.11.15
Hermes Version
Config version 23; exact
hermes versionnot captured yet.Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
hermes_cli/doctor.pydynamically includes thegeminiAPI-key provider via_build_apikey_providers_list(). The dynamic tuple includesGOOGLE_API_KEY/GEMINI_API_KEYandhttps://generativelanguage.googleapis.com/v1beta/models.The API-key health-check loop then uses the generic OpenAI-compatible probe:
GET {base}/modelswithAuthorization: Bearer <key>. Google AI Studio Gemini API keys are not OpenAI-compatible bearer tokens; they require Google-style auth such asx-goog-api-key: <key>or?key=<key>against Gemini endpoints.Proposed Fix (optional)
Add a Gemini-specific doctor connectivity path that probes
GET {base}/modelsusingx-goog-api-key, with default base URLhttps://generativelanguage.googleapis.com/v1betaand optionalGEMINI_BASE_URLoverride. Also ensureGOOGLE_API_KEY,GEMINI_API_KEY, andGEMINI_BASE_URLare recognized by the.envprovider-config detector.Are you willing to submit a PR for this?