Agents chats on Gemini 4 Carbon, Neon, and Hydrogen show no reasoning.
`googleSupportedThinkingLevels` did not recognize the `carbon`, `neon`,
and `hydrogen` name tokens and failed closed, so
`rewriteGoogleCompatThinkingConfig` left these requests as plain
`reasoning_effort` with no `thinking_config`. Google's OpenAI-compatible
endpoint returns no thought text unless `include_thoughts` is set, and
the same check also drops a pinned
`provider_options.google.thinking_config` from the model config.
The three tokens now classify like `pro` and `argon`: LOW, MEDIUM, and
HIGH. Neon and Hydrogen also accept XHIGH, but fantasy's Google provider
has no such level, so they top out at HIGH.
Live requests through dogfood's AI Gateway `agents-google` provider
(Google's OpenAI-compatible endpoint) with `include_thoughts: true`:
| `thinking_level` | Carbon | Neon | Hydrogen |
|---|---|---|---|
| `minimal` | 400 | 400 | 400 |
| `low`, `medium`, `high` | 200, thought text | 200, thought text | 200,
thought text |
| `xhigh` | 400 | 200 | 200 |
Neon with only `reasoning_effort` (`high` or `none`), the request shape
before this change, returns 200 with no thought text.
**Gemini patches now follow the AI provider's upstream.** chatd builds
every model through AI Gateway, so the openai-compat client's base URL
is always `http://coder-aibridge/v1`, and the Gemini patches (thinking
config, thought signatures, thought response rewrite) were chosen by
model ID. On an OpenRouter or Vercel provider, a `google/gemini-*`
request had its effort moved into `extra_body.google.thinking_config`,
which AI Gateway forwards only to Google, so the upstream received no
reasoning effort. This already affected Argon and Gemini 3.x on those
providers, and recognizing the new models would have extended it to
them. `ModelFromConfig` now takes the AI provider's base URL, the URL
the gateway sends the request to, and decides with
`googleopenai.ShouldPatchGoogleUpstreamRequest`, the predicate the
gateway uses for its own Google patches. On a Google provider, model IDs
without a `gemini-` prefix now also get the thought response rewrite,
which leaves responses without thought output unchanged.
> 🤖 Created with the help of Coder Agents.