Skip to content

fix: validate Gemini API keys with native header#24266

Closed
ctraupel wants to merge 1 commit into
NousResearch:mainfrom
ctraupel:fix/doctor-gemini-api-key-probe
Closed

fix: validate Gemini API keys with native header#24266
ctraupel wants to merge 1 commit into
NousResearch:mainfrom
ctraupel:fix/doctor-gemini-api-key-probe

Conversation

@ctraupel

Copy link
Copy Markdown

Summary

  • add a dedicated hermes doctor Gemini connectivity probe using x-goog-api-key
  • exclude Gemini from the generic Bearer-token API-key probe
  • cover the behavior with a doctor regression test

Test Plan

  • ./venv/bin/python -m pytest tests/hermes_cli/test_doctor.py -q -o 'addopts='

Hermes doctor previously discovered the Gemini provider through the generic API-key probe. That probe uses Bearer auth against /models, which makes valid Google AI Studio keys look invalid.

Add a dedicated Gemini probe that calls the native models endpoint with x-goog-api-key and exclude Gemini from the generic Bearer probe.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists provider/gemini Google Gemini (AI Studio, Cloud Code) comp/cli CLI entry point, hermes_cli/, setup wizard labels May 12, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #20642 which already implements this fix (x-goog-api-key header for Gemini doctor probe) bundled with SMS opt-out. Also duplicates #22489, #22468, #22286.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (medium confidence):
Main already pops Authorization and adds x-goog-api-key for Gemini in hermes_cli/doctor.py:1550-1551; the root cause of red-checks on valid GOOGLE_API_KEY is addressed inline.

If you still see this on the latest version, please reopen with reproduction steps.

(Bulk-closed during a CLI triage sweep.)

@teknium1 teknium1 closed this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists provider/gemini Google Gemini (AI Studio, Cloud Code) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants