Repository navigation
Description
Description
When using Gemini 3 models (e.g., google/gemini-3-flash-preview), clawdbot sends the full model ID including the provider prefix to the Google Generative AI API, but the API expects only the model name without the prefix.
Error: 404 Not Found from Google Generative AI API
Environment
- clawdbot version: 2026.1.9 (also affects 2026.1.10, 2026.1.11-4)
- @mariozechner/pi-ai version: 0.43.0
- Model:
google/gemini-3-flash-preview(also affects other Gemini 3 models) - Node.js: v22.21.1
Steps to Reproduce
- Configure clawdbot with Gemini 3 model:
{ "agents": { "defaults": { "model": { "primary": "google/google/gemini-3-flash-preview" } } }, "models": { "providers": { "google": { "models": [ { "id": "google/gemini-3-flash-preview", "name": "Gemini 3 Flash Preview" } ] } } } } - Send a message to the bot
- Bot returns 404 error from Google API
Expected Behavior
The bot should strip the google/ prefix from the model ID before sending it to the Google API.
Actual Behavior
The bot sends the full model ID google/gemini-3-flash-preview to the API, which expects only gemini-3-flash-preview.
Root Cause
In node_modules/@mariozechner/pi-ai/dist/providers/google.js (around line 262-268), the model ID is passed directly without stripping the provider prefix:
const params = {
model: model.id, // ← Sends "google/gemini-3-flash-preview"
contents,
config,
};
Proposed Solution
Strip the provider prefix before sending to the Google API:
// Fix: Extract just the model name without provider prefix for Google API
const modelName = model.id.includes('/') ? model.id.split('/').pop() : model.id;
const params = {
model: modelName, // ← Sends "gemini-3-flash-preview"
contents,
config,
};
Workaround
Manually patch node_modules/@mariozechner/pi-ai/dist/providers/google.js after each npm update:
const params = {
-
model: model.id,
-
// Fix: Extract just the model name without provider prefix for Google API -
const modelName = model.id.includes('/') ? model.id.split('/').pop() : model.id; -
};
model: modelName, contents, config,
Additional Context
This fix should be added to the existing patches/@[email protected] file in clawdbot, or submitted upstream to https://github.com/badlogic/pi-mono.
The current patch file doesn't include dist/providers/google.js, so this issue affects all Gemini 3 users.
Verification
After applying the fix, Gemini 3 models work correctly with the Google Generative AI API.
Tested with:
- clawdbot 2026.1.9, 2026.1.10, 2026.1.11-4
- @mariozechner/pi-ai 0.42.2, 0.43.0
- google/gemini-3-flash-preview
- Node.js v22.21.1
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
juanpablodlc commentedon Jan 12, 2026
I tried implementing a fix in #797 , but ended up closing the 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.
@pein1337-jpg - the fix you proposed in #795 is ready in the patch file. Once Swift lint is fixed upstream, we can merge this I believe.
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection
Models: normalize Gemini 3 ids in runtime selection