Skip to content

fix(doctor): use x-goog-api-key for Gemini API-key probes#23008

Closed
KhanCold wants to merge 4 commits into
NousResearch:mainfrom
KhanCold:fix/gemini-doctor-x-goog-api-key
Closed

fix(doctor): use x-goog-api-key for Gemini API-key probes#23008
KhanCold wants to merge 4 commits into
NousResearch:mainfrom
KhanCold:fix/gemini-doctor-x-goog-api-key

Conversation

@KhanCold

@KhanCold KhanCold commented May 10, 2026

Copy link
Copy Markdown

Closing as this duplicates existing work. Will focus on cleaner, focused PRs going forward.

KhanCold added 4 commits May 10, 2026 12:41
The LF-submit fix for thin PTYs (commit 5044e1c) regressed multiline
composition on macOS by binding c-j (LF) to submit unconditionally on
POSIX. Shift+Enter is delivered as c-j on many terminals, so it stopped
inserting newlines and submitted the message instead.

Upstream added install_shift_enter_alias() for CSI-u/modifyOtherKeys
terminals, but default macOS Terminal still sends bare LF for Shift+Enter.
This change complements upstream's approach.

Changes:
- _bind_prompt_submit_keys(): only bind 'enter'; remove unconditional
c-j binding so the caller can decide based on environment.
- In the CLI setup block, bind c-j to newline by default on POSIX local
terminals (not WSL/SSH/WT which are handled by _preserve_ctrl_enter_newline).
- When HERMES_CLI_SUBMIT_ON_LF=1 is set, bind c-j to submit instead,
opt-in for thin PTYs that deliver Enter as LF.

Adds regression tests covering:
- default POSIX: c-j inserts newline
- env HERMES_CLI_SUBMIT_ON_LF=1: c-j submits
- WSL/SSH/WT: c-j left untouched (has its own binding)

Fixes NousResearch#22908
NousResearch#22660)

Two methods in MemoryStore called .fetchone()["field"] without first
checking if fetchone() returned None, causing TypeError in race conditions.

- add_fact: after sqlite3.IntegrityError, the duplicate row may have been
deleted by a concurrent operation before the fallback SELECT executes.
  → Guard with explicit None check; raise RuntimeError for this
    impossible-but-observed state.

- update_fact: when category is not provided, a second SELECT fetches the
current category. If the row was deleted between the first SELECT and this
second one, fetchone() returns None.
  → Guard with explicit None check; return False (row no longer exists).

Fixes NousResearch#22660
…search#22569)

cron.jobs.load_jobs called data.get("jobs", []) immediately after
json.load(), assuming the root is always a dict. If jobs.json is
hand-edited or written by a legacy release in a non-dict shape
(bare list, null, scalar, string), the call crashes with AttributeError.

Changes:
- Guard both json.load() and json.loads(strict=False) paths with
  isinstance(data, dict) checks.
- If data is a bare list (legacy format), auto-migrate by calling
  save_jobs() and return the list.
- If data is any other non-dict shape, log an error and return []
  instead of crashing.

Fixes NousResearch#22569
…ch#22489)

The generic API-key health-check loop sends
to every provider, but Google AI Studio (generativelanguage.googleapis.com)
rejects Bearer tokens and requires  instead. This made
 falsely report Gemini as unreachable or invalid.

Changes:
- In , detect Gemini by checking whether the
  resolved base URL host matches .
- For Gemini endpoints, set  instead of .
- All other providers continue using  unchanged.

Fixes NousResearch#22489
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/gemini Google Gemini (AI Studio, Cloud Code) P3 Low — cosmetic, nice to have labels May 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #20642 (and #22286) — same fix (use x-goog-api-key header for Gemini doctor probe). #20642 is broader and already reviewed.

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 P3 Low — cosmetic, nice to have 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.

2 participants