fix: omit thinkingConfig for Gemini Flash Image models without thinking support
@aheritier is already working on this.
Since Sep 11, 2026.
- Dominant language
- Go
- Stars
- 3.3k
- Forks
- 462
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 273
Description
Problem
google/gemini-2.5-flash-image rejects the no-thinking request shape used by Docker Agent in some paths. A minimal text request succeeds when thinkingConfig is omitted, but the same request with thinkingConfig: {"thinkingBudget": 0} returns HTTP 400 INVALID_ARGUMENT: Thinking is not enabled for this model.
Docker Agent's WithNoThinking / MCP sampling path can serialize this shape, causing requests to fail for Gemini Flash Image.
Evidence
Isolated gateway probes on 2026-09-10 reproduced the behavior:
thinkingConfigomitted: accepted.thinkingConfig: {"thinkingBudget": 0}: rejected with the 400 above.
Sanitized reproduction
The following is illustrative and contains no credentials:
{
"model": "google/gemini-2.5-flash-image",
"contents": [{"role": "user", "parts": [{"text": "Reply with OK"}]}],
"thinkingConfig": {"thinkingBudget": 0}
}
Send the JSON to the configured Gemini-compatible gateway with a redacted bearer credential, for example:
curl -sS -X POST "https://<gateway>/v1beta/models/google%2Fgemini-2.5-flash-image:generateContent" \
-H "Authorization: Bearer <REDACTED>" \
-H "Content-Type: application/json" \
--data @request.json
Expected behavior
Omit thinkingConfig for models that do not support thinking. Retain the existing disable-thinking semantics for models that do support thinking.
Scope
This issue covers the confirmed Gemini Flash Image incompatibility only. The unconfirmed Gemini 3.8 failure is explicitly out of scope.
Related epic: #3996
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.