Skip to content

fix: strip provider prefix from Google model IDs (#795) - #797

Closed
juanpablodlc wants to merge 2 commits into
openclaw:mainfrom
juanpablodlc:fix/gemini-model-id-prefix
Closed

juanpablodlc wants to merge 2 commits into
openclaw:mainfrom
juanpablodlc:fix/gemini-model-id-prefix

Conversation

@juanpablodlc

@juanpablodlc juanpablodlc commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #795 reported by @pein1337-jpg

Problem

Gemini 3 models returned 404 Not Found because the full model ID
(e.g., `google/gemini-3-flash-preview`) was being sent to the
Google Generative AI API, which expects only the model name
without the provider prefix.

Solution

The fix extracts just the model name before sending to the API:

  • `google/gemini-3-flash-preview` → `gemini-3-flash-preview`
  • `gemini-3-flash-preview` → `gemini-3-flash-preview` (unchanged)

This was done by updating `patches/@[email protected]`
to include changes to `dist/providers/google.js`.

Changed Files

  • `patches/@[email protected]` (added google.js model ID stripping)
  • `pnpm-lock.yaml` (updated patch hash)

Testing

Verified with:

  • clawdbot 2026.1.9-2026.1.11-4
  • @mariozechner/pi-ai 0.42.2-0.43.0
  • Node.js v22.21.1

Credit

Fix originally proposed and validated by @pein1337-jpg in #795

@juanpablodlc
juanpablodlc force-pushed the fix/gemini-model-id-prefix branch from e4c7a00 to 5330bd4 Compare January 12, 2026 19:10
Fixes openclaw#795 reported by @pein1337-jpg

Gemini 3 models returned 404 Not Found because the full model ID
(e.g., "google/gemini-3-flash-preview") was being sent to the
Google Generative AI API, which expects only the model name
without the provider prefix.

The fix extracts just the model name before sending to the API:
- "google/gemini-3-flash-preview" → "gemini-3-flash-preview"
- "gemini-3-flash-preview" → "gemini-3-flash-preview" (unchanged)

Credit: Fix originally proposed by @pein1337-jpg in openclaw#795

## Changed Files
- patches/@[email protected] (added google.js model ID stripping)
- pnpm-lock.yaml (updated patch hash)

Co-authored-by: pein1337-jpg <[email protected]>
@juanpablodlc
juanpablodlc marked this pull request as draft January 12, 2026 19:30
- Sort imports alphabetically in src/cli/program.ts
- Sort vitest imports in src/commands/dashboard.test.ts
- Sort imports and fix formatting in src/commands/dashboard.ts

These are pre-existing linting issues in upstream/main that were
blocking CI. They are unrelated to the main PR fix.

Co-authored-by: pein1337-jpg <[email protected]>
@juanpablodlc
juanpablodlc force-pushed the fix/gemini-model-id-prefix branch from 5330bd4 to d936418 Compare January 12, 2026 19:31
@juanpablodlc

Copy link
Copy Markdown
Contributor Author

Closing this PR due to pre-existing Swift linting errors blocking CI.

Issue

The CI check for macOS Swift linting is failing with errors in:

  • apps/macos/Sources/ClawdbotWizardCLI/main.swift (lines 25, 27, 29, 35, 119, 121, 122)
  • apps/macos/Sources/Clawdbot/OnboardingWizard.swift (line 152)

These errors exist in upstream/main and are not caused by any changes in this PR.

What this PR does

This PR only modifies:

Next Steps

This PR should be re-opened after the Swift linting issues are fixed in a separate PR.

@pein1337-jpg - the fix you proposed in #795 is ready in the patch file. Once Swift lint is fixed upstream, we can merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gemini 3 models return 404 Not Found - Invalid model ID sent to Google API

1 participant