Skip to content

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

Closed

Description

@pein1337-jpg

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

  1. 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"
              }
            ]
          }
        }
      }
    }
  2. Send a message to the bot
  3. 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

Activity

  1. added
    bug
    on Jan 12, 2026
  2. juanpablodlc commented on Jan 12, 2026

    @juanpablodlc
    Contributor

    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.

  3. added a commit that references this issue on Jan 13, 2026
    ab99390
  4. added 2 commits that reference this issue on Jan 13, 2026
    eda5271
    24b00b1
  5. locked as resolved and limited conversation to collaborators on Mar 8, 2026
  6. added a commit that references this issue on Apr 28, 2026
    6f828fb
  7. added a commit that references this issue on May 9, 2026
    6d377c5
  8. added a commit that references this issue on Sep 11, 2026
    877f68a
  9. added a commit that references this issue on Oct 11, 2026
    95acce6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions