-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Google Gemini chat model routes to openai-responses transport (401), native @google/genai transport never selected #88480
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Chat completions for a
google/*model are dispatched through theopenai-responsestransport instead of the native Google (@google/genai) transport. The Gemini API key is then sent as a Bearer token to OpenAI's/responsesendpoint, which (correctly) rejects it with a 401. The native Google transport is never reached.This makes it impossible to use a Google Gemini model as a chat model (heartbeat, subagent, or main) even though:
curltogenerativelanguage.googleapis.comreturns HTTP 200), andconfiguredinopenclaw models list.Environment
2026.5.28 (e932160)— also reproduced on2026.5.27 (27ae826)@openclaw/google-provider(stock) enabledAQ.format (not the legacyAIza…format)Observed log
Note
provider=google api=openai-responses— the provider is correctly identified asgoogle, but the transport selected isopenai-responses.Reproduction
google/gemini-2.5-flash-lite, set asagents.defaults.heartbeat.model(or spawn a subagent with--model google/gemini-2.5-flash-lite).AQ.format viaGEMINI_API_KEYenv var./responseswith the Gemini key → 401.What I ruled out (none fixed it)
GEMINI_API_KEYandGOOGLE_API_KEYenv vars (both present, gateway env verified).auth.profiles."google:default"={ provider: "google", mode: "api_key" }inopenclaw.json.auth-profiles.json:{ type: "api_key", provider: "google", key: "AQ.…" }— identical structure to the workinganthropic:defaultprofile.models.providers.google.models[]registration with canonical idgemini-2.5-flash-lite.google/gemini-2.5-flash-lite.Anthropic models work perfectly with the analogous inline
auth-profiles.jsonentry, so the credential-resolution wiring is fine for anthropic but the transport selection forgooglefalls back toopenai-responses.Suspected cause
The provider→transport resolver does not select the native
@google/genaitransport for thegoogleprovider (at least when the key is in the newAQ.AI Studio format), and falls through to the genericopenai-responsesdefault. The key-format detection (legacyAIza…vs newAQ.…) is a likely trigger.Direct-key sanity check (proves key + endpoint are good)