Gemma 4 models use "thinkingLevel" instead of "thinkingBudget" and only support "MINIMAL" or "HIGH" levels. The current implementation returns 400 errors for Gemma 4. This feature requests proper support for Gemma 4's thinking API.
Gemma 4 models (gemma-4-31b-it, gemma-4-26b-a4b-it) support extended thinking via the Google Generative AI API, but use `thinkingLevel` instead of `thinkingBudget`. Currently, pi routes all non-Gemini-3 Google models through the `thinkingBudget` path, which returns a 400 error for Gemma 4. Additionally, Gemma 4 only supports two thinking levels: `MINIMAL` and `HIGH`. Sending `LOW` or `MEDIUM` also returns 400. **Proposed fix:** https://github.com/yairwein/pi-mono/tree/feat/gemma4-thinking-support 1. Add `isGemma4Model()` detection via `/gemma-?4/` regex 2. Route Gemma 4 through the `thinkingLevel` path in `streamSimpleGoogle` (same as Gemini 3) 3. Map pi thinking levels to Gemma 4's supported set: minimal/low → MINIMAL, medium/high → HIGH 4. Add a docs example in `models.md` showing how to configure Gemma 4 via `google-generative-ai` API with `baseUrl` All changes are in `packages/ai/src/providers/google.ts` and `packages/coding-agent/docs/models.md`. Tests pass (`npm run check`).