fix: resolve google provider default API to google-generative-ai#88512
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 30, 2026, 11:49 PM ET / 03:49 UTC. Summary PR surface: Source +7. Total +7 across 1 file. Reproducibility: yes. from source, not from a live run: current main defaults baseUrl-only provider configs to Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Move the provider-specific default into the Google provider runtime/policy hook or a generic provider-owned hook contract, add focused regression coverage for baseUrl-only Google config, and require redacted real behavior proof before merge. Do we have a high-confidence way to reproduce the issue? Yes from source, not from a live run: current main defaults baseUrl-only provider configs to Is this the best way to solve the issue? No: the intended behavior is right, but the current patch puts a Google-specific fallback in core instead of the Google provider boundary or a generic provider hook. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against e1a98171417c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +7. Total +7 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This seems to target the right misrouting symptom, but I am a little nervous about hard-coding |
…nclaw#88480) When a configured Google provider/model row had no explicit but had a baseUrl set, the fallback defaulted to openai-completions, causing Gemini requests to route through the OpenAI Responses transport instead of the native @google/genai transport. Made resolveConfiguredProviderDefaultApi provider-aware: for the google provider, the default API is now google-generative-ai. Root cause: the generic fallback assumed any provider with a baseUrl should use openai-completions, which is incorrect for Google's native Gemini API.
b14ff96 to
5a15bd1
Compare
…nclaw#88480) (openclaw#88512) When a configured Google provider/model row had no explicit but had a baseUrl set, the fallback defaulted to openai-completions, causing Gemini requests to route through the OpenAI Responses transport instead of the native @google/genai transport. Made resolveConfiguredProviderDefaultApi provider-aware: for the google provider, the default API is now google-generative-ai. Root cause: the generic fallback assumed any provider with a baseUrl should use openai-completions, which is incorrect for Google's native Gemini API. Co-authored-by: xin <1052326311+xin@users.noreply.github.com>
…nclaw#88480) (openclaw#88512) When a configured Google provider/model row had no explicit but had a baseUrl set, the fallback defaulted to openai-completions, causing Gemini requests to route through the OpenAI Responses transport instead of the native @google/genai transport. Made resolveConfiguredProviderDefaultApi provider-aware: for the google provider, the default API is now google-generative-ai. Root cause: the generic fallback assumed any provider with a baseUrl should use openai-completions, which is incorrect for Google's native Gemini API. Co-authored-by: xin <1052326311+xin@users.noreply.github.com>
…nclaw#88480) (openclaw#88512) When a configured Google provider/model row had no explicit but had a baseUrl set, the fallback defaulted to openai-completions, causing Gemini requests to route through the OpenAI Responses transport instead of the native @google/genai transport. Made resolveConfiguredProviderDefaultApi provider-aware: for the google provider, the default API is now google-generative-ai. Root cause: the generic fallback assumed any provider with a baseUrl should use openai-completions, which is incorrect for Google's native Gemini API. Co-authored-by: xin <1052326311+xin@users.noreply.github.com>
Fixes #88480
Summary
openai-completions.models.providers.googleconfigs togoogle-generative-ai, while explicitapi: openai-completionsstays unchanged.Verification
OPENCLAW_VITEST_NO_OUTPUT_TIMEOUT_MS=300000 OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/pr88512-model-vitest-cache2 fnm exec --using=24.15.0 node scripts/run-vitest.mjs run src/agents/embedded-agent-runner/model.test.ts extensions/google/api.test.tsfnm exec --using=24.15.0 node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile /tmp/pr88512-test-src2.tsbuildinfofnm exec --using=24.15.0 node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.extensions.test.json --incremental --tsBuildInfoFile /tmp/pr88512-extensions-test.tsbuildinfogit diff --checkReal behavior proof
Behavior addressed: Google provider configs with
models.providers.google.baseUrland omittedapinow resolve to the native Geminigoogle-generative-aitransport instead of the OpenAI-compatible transport.Real environment tested: Local OpenClaw checkout at
5a15bd1c79740f7538d31c7cbde2483c4887b0a3, Node 24.15.0, Google Gemini API key read from 1Password itemAI API Key - Google Gemini - GEMINI_API_KEY - steipete-m5; key value was not printed.Exact steps or command run after this patch: Resolved the Google provider transport for provider
google, omittedapi, and baseUrlhttps://generativelanguage.googleapis.com, then used the same 1Password Gemini key for a livegenerateContentrequest togemini-2.0-flash.Evidence after fix: Copied live output from the redacted terminal capture:
Observed result after fix: The omitted-api Google config selected the native Gemini transport, and the live Google endpoint accepted the configured key with HTTP 200.
What was not tested: A full packaged gateway chat loop was not run; the focused resolver path, Google provider hook, and live Gemini endpoint were verified directly.