Skip to content

fix: correct gemini doctor api-key probe#22489

Closed
Jeffgithub0029 wants to merge 1 commit into
NousResearch:mainfrom
Jeffgithub0029:fix/gemini-doctor-apikey-probe
Closed

fix: correct gemini doctor api-key probe#22489
Jeffgithub0029 wants to merge 1 commit into
NousResearch:mainfrom
Jeffgithub0029:fix/gemini-doctor-apikey-probe

Conversation

@Jeffgithub0029

Copy link
Copy Markdown

Summary

  • use x-goog-api-key instead of Authorization: Bearer when doctor probes Google AI Studio Gemini endpoints
  • keep the generic bearer-token probe for other API-key providers
  • add a regression test covering the Gemini health check path

Why

Google AI Studio API keys are rejected when sent as Authorization: Bearer ... to generativelanguage.googleapis.com, which made hermes doctor report valid Gemini keys as invalid even though real Hermes requests worked.

Test Plan

  • python -m pytest tests/hermes_cli/test_doctor.py -o 'addopts=' -q\n- [x] hermes doctor shows ✓ gemini with a valid GOOGLE_API_KEY\n- [x] hermes chat --provider gemini --model gemini-2.5-flash -q 'Reply with exactly: HERMES_GEMINI_OK_AFTER_PATCH'\n

@Jeffgithub0029

Copy link
Copy Markdown
Author

This PR comes from a fork, so GitHub Actions appear to be waiting for maintainer approval before any jobs can start. Once approved, I’ll follow up on the checks.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard provider/gemini Google Gemini (AI Studio, Cloud Code) duplicate This issue or pull request already exists labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #20642 — same Gemini doctor probe fix (x-goog-api-key header instead of Bearer auth). #20642 bundles this with the SMS opt-out fix.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as already fixed on main.

Triage notes (high confidence):
origin/main hermes_cli/doctor.py:1543-1551 already swaps Authorization Bearer for x-goog-api-key on generativelanguage.googleapis.com.

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 duplicate This issue or pull request already exists 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