{"slug": "patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped", "title": "Patzer v7.21 + v7.22: a Gemini coach, and what broke after it shipped", "summary": "The open-source Patzer chess app shipped v7.21 and v7.22, adding Google Gemini as a coach provider through its OpenAI-compatible endpoint while keeping the existing client code intact. The releases also fixed a Play-vs-Friend refetch loop that froze browser tabs, scaled the thinking-token reserve for always-thinking Gemini models, and added streaming coach answers, cost warnings before testing all models, and a two-tap Resign. The project now supports Ollama, vLLM, LM Studio, DeepSeek and Gemini, with the provider pattern documented in server/src/llm-providers.ts.", "body_md": "I keep coming back to the same design line with Patzer: the engine does the thinking, the model does the talking. The server works out what a move allows, hangs or wins, and the LLM only turns that into a sentence a ten-year-old can follow. It is also why adding a new coach provider is a small change rather than a rewrite.\n\nThe newest one, shipped in v7.21.0, is Google AI Studio (PR #107, by [@66ton99](https://dev.to/66ton99)). The coach can now talk to Gemini through its OpenAI-compatible endpoint, so the existing client code stays and only the provider entry is new. Three details from that PR are worth a look if you are wiring an LLM into anything:\n\n`-latest` aliases) \"none\" is mapped to \"low\" and the response budget gets 1024 extra tokens, because the thinking tokens come out of the same `max_tokens` you asked for and the visible answer comes back empty otherwise.`reasoning_effort` with a 400 (including the very unhelpful \"Request contains an invalid argument.\"), the request is retried without it, the thinking reserve is kept, and the per-model outcome is cached so the next call does not pay for the failed round-trip again.`/models` catalog is filtered to chat-capable models, and the `models/` prefix is stripped only for Gemini — other providers need it, so a blanket strip breaks them.\nTwo more things landed in the same release, both about not lying to the user. \"Test ALL models\" now says what it will cost before it starts: on DeepSeek and Gemini every model is a paid call of up to 30 seconds, and the button used to fire all of them off without asking. And coach answers now stream to the browser one chunk at a time — the streaming callback was never awaited, so an answer could arrive out of order, while an error writing to a browser that had already gone away was swallowed and left the model generating until the hard timeout.\n\nThat is the whole trick with provider support: the interesting work is in the edge cases, not the endpoint URL.\n\nThe edge cases then found us. v7.21.1 killed a loop where Play → vs Friend refetched the lobby on every response, which re-ran the fetch, until the browser ran out of connections and the tab froze (PR #109, reported and diagnosed by @dloyd09). v7.22.0 caught the thinking reserve being too small: on always-thinking Gemini models it ran out of `max_tokens` in the middle of a JSON game review, so the reserve now scales with the reasoning level (4096 / 8192 / 16384) and a length-truncated response widens `numPredict` on retry instead of hitting the same ceiling again. Same release adds live percentage and ply progress while Game Review analyzes, and makes Resign take two taps, because a stray click should not end a game (PRs #118, #119, #113, #114 — all of it from @JacobStephens2).\n\nThe same contributor who gave us Gemini also gave the coach LM Studio and DeepSeek earlier, so the list is now Ollama, vLLM, LM Studio, DeepSeek and Gemini — local first, cloud optional. If the provider you want is missing, the pattern is in `server/src/llm-providers.ts` and it is a genuinely small PR.\n\nOne Docker container, MIT licensed, your games stay on your LAN:\n\n[https://github.com/SikamikanikoBG/patzer](https://github.com/SikamikanikoBG/patzer)", "url": "https://wpnews.pro/news/patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped", "canonical_source": "https://dev.to/sikamikanikobg/patzer-v721-v722-a-gemini-coach-and-what-broke-after-it-shipped-4hdi", "published_at": "2026-11-30 23:04:17+00:00", "updated_at": "2026-11-30 23:15:55.161377+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["Patzer", "Google AI Studio", "Gemini", "DeepSeek", "LM Studio", "Ollama", "vLLM", "SikamikanikoBG"], "also_reported_by": [], "takeaway": "When wiring an OpenAI-compatible provider like Gemini, reserve extra max_tokens for thinking output, retry without reasoning_effort on a 400 while caching the outcome, and strip the models/ prefix only for providers that need it.", "recommendation": {"advice": "Budget extra max_tokens for reasoning models' thinking tokens and retry without unsupported parameters like reasoning_effort, caching the per-model outcome so failed round-trips aren't repeated.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped", "markdown": "https://wpnews.pro/news/patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped.md", "text": "https://wpnews.pro/news/patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped.txt", "jsonld": "https://wpnews.pro/news/patzer-v7-21-v7-22-a-gemini-coach-and-what-broke-after-it-shipped.jsonld"}}