Regression - Gemini flash lite with thinking broken after upgrade to 2026.8.0

After updating discourse to v2026.8.0 LLM using Gemini Flash Lite with thinking enabled throws an error 400.

Here’s the configuration (that working before the upgrade)

When I run it now it throws

Non-streaming request failed: { “error”: { “code”: 400, “message”: “Request contains an invalid argument.”, “status”: “INVALID_ARGUMENT” } }

If I disable thinking then it works.

I enable thinking, the issue goes back to a regression bug that I had reported last year, it appears I need to hardcode the number of tokens used for thinking and it won’t accept 0 or -1 and won’t accept nothing even though it says it’s optional.

It only seems to affect the Flash Lite model but not the Flash model (which works just fine even without any thinking tokens specified and thinking enabled).

The Pro model is completely broken, I can’t get it work at all after the upgrade, I get an internal server error.

Why are you using the legacy API? Can you switch to the non-legacy API and use: gemini-3.5-flash-lite?

Because it’s an upgrade Sam. Cannot keep up with the pace at which Gemini is churning models and API’s. The idea is to keep Discourse stable and running with that works and minimal changes.

I don’t see google shutting off the “legacy” model endpoints for years in the future, too many apps and systems are using them and like any corporation, once things are in production you don’t deprecate them within months. I would similarly expect things that are working in discourse to continue working (until discourse gets rid of them). If the model endpoints are supported in discourse, then it should continue working as they did before the upgrade.

Plus I noted the point about the latest model id not being supported by the interaction endpoints - that in itself is big problem and introduces significant administrative overhead.
Say I set it up to use the 3.5 endpoint and 6 months down the line google retires it - who informs me that 3.5 is retired? Discourse doesn’t - neither does gemini (because its’ running through discourse). End result is suddenly one day everything stops working and now we’re trying to figure out what happened.