Skip to content

[BUG] Gemini models in WSL env: Request contains an invalid argument. #12202

@TanteJossa

Description

@TanteJossa

Problem (one or two sentences)

When using any gemini model in a project in vscode that is in wsl environment I get the following error. see below for logs.

Context (who is affected and when)

Users of Gemini models in wsl environment

Reproduction steps

  1. Computer version info
    WSL version: 2.4.12.0
    Kernel version: 5.15.167.4-1
    WSLg version: 1.0.65
    MSRDC version: 1.2.5716
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.26100.1-240331-1435.ge-release
    Windows version: 10.0.26200.8246

  2. roo version
    3.53.0

  3. vscode version
    Version: 1.117.0 (user setup)
    Commit: 10c8e557c8b9f9ed0a87f61f1c9a44bde731c409
    Date: 2026-04-21T16:12:14-07:00
    Electron: 39.8.7
    ElectronBuildId: 13841579
    Chromium: 142.0.7444.265
    Node.js: 22.22.1
    V8: 14.2.231.22-electron.0
    OS: Windows_NT x64 10.0.26200

  4. select gemini model and send a message when vscode is inialized in wsl

Expected result

google accepting request

Actual result

google not accepting request

Variations tried (optional)

No response

App Version

3.53.0

API Provider (optional)

Google Gemini

Model Used (optional)

N/A

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

// Please share this file with Roo Code Support (support@roocode.com) to diagnose the issue faster
// Just make sure you're OK sharing the contents of the conversation below.

{
  "error": {
    "timestamp": "2026-04-26T18:33:49.190Z",
    "version": "3.53.0",
    "provider": "gemini",
    "model": "gemini-3-flash-preview",
    "details": "Gemini generate context stream error: {\"error\":{\"message\":\"{\\n  \\\"error\\\": {\\n    \\\"code\\\": 400,\\n    \\\"message\\\": \\\"Request contains an invalid argument.\\\",\\n    \\\"status\\\": \\\"INVALID_ARGUMENT\\\"\\n  }\\n}\\n\",\"code\":400,\"status\":\"Bad Request\"}}"
  },
  "history": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "<user_message>\ntest\n</user_message>"
        },
        {
          "type": "text",
          "text": "<environment_details>\n# VSCode Visible Files\n../../../../tmp/roo-diagnostics-019dcb0f-1777228321009.json\n\n# VSCode Open Tabs\nrole-group-system-design.md,../../../../tmp/roo-diagnostics-019dcb0f-1777228321009.json\n\n# Current Time\nCurrent time in ISO 8601 UTC format: 2026-04-26T18:33:45.591Z\nUser time zone: Europe/Leiden, UTC+2:00\n\n# Current Cost\n$0.00\n\n# Current Mode\n<slug>ask</slug>\n<name>❓ Ask</name>\n<model>gemini-3-flash-preview</model>\n\n\n# Current Workspace Directory (/home/user/code/project) Files\n\n(File list truncated. Use list_files on specific subdirectories if you need to explore further.)\nYou have not created a todo list yet. Create one with `update_todo_list` if your task is complicated or involves multiple steps.\n</environment_details>"
        }
      ],
      "ts": 1777228425642
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions