Skip to content

v1.2.1 — fix Gemini Grep/Glob InputValidationError

Choose a tag to compare

@testAccountDeltas testAccountDeltas released this 12 Oct 02:52
· 17 commits to main since this release

Why this release

Gemini (via this gateway) reliably mishandles Claude Code's multi-field Grep/Glob tool schemas — it puts the search string under description instead of pattern, or drops required fields, producing a hard failure on essentially every search:

Error: InputValidationError: Grep failed due to the following issues:
The required parameter `pattern` is missing
An unexpected parameter `description` was provided

This isn't occasional — it's the default outcome any time the model tries to search, confirmed live. The same root cause was already diagnosed and fixed once before in a sibling project (opencode, same Gemini backend): Gemini reliably handles one general shell tool (a free-text command string) but fumbles mapping intent into several named fields. Denying the specialized tools and forcing shell-only fixed it there 3/3 with zero errors — same fix applied here.

What changed

  • Grep and Glob are stripped from the outgoing tools array on every request, unconditionally, with an OS-aware system hint telling the model to search via the shell instead. Unconditional and deterministic, so it never disturbs the upstream prompt cache.
  • Native PowerShell tool enabled (CLAUDE_CODE_USE_POWERSHELL_TOOL=1, a Claude Code preview feature) instead of routing through Bash → powershell.exe/grep. A/B tested live on Windows: the Bash-wrapped route needed up to 5 tool calls/21s per search due to quoting and encoding friction (Bash expanding $ variables meant for PowerShell, garbled Cyrillic output); the native tool resolved the same searches in exactly 1 tool call every time, 3/3 runs, zero errors — no Bash intermediary means no quoting collision to get wrong in the first place.
    • Windows: always enabled — powershell.exe is guaranteed present.
    • macOS/Linux: this flag is cross-platform, but needs PowerShell 7+ (pwsh) in PATH, which isn't installed by default. The installer now detects pwsh at install time (shutil.which) and enables the flag only when found — if you already have it (brew install powershell), you get the same reliability improvement; otherwise it falls back to the existing grep/find shell hint, unchanged.
  • The shell-hint fallback (used when the native tool isn't available) warns about Bash/PowerShell quoting ($ variables need single-quoting the whole -Command argument) and prefixes a UTF-8 console-encoding setup for non-ASCII text.

Recommended action

If you've already installed this tool, run /clear in your next Claude Code session — old conversation history containing tool_use: Grep/Glob calls can still confuse the model even after the tool is hidden. Re-running the installer (or just restarting Claude Code after a git pull) picks up the new launcher settings.