What changed: a client that takes the gateway for an Ollama server (its
/api/show is answered in Ollama's shape) sends Ollama's per-request
options beside its Chat fields. The google preset serves a model on
Gemini's OpenAI-compatible endpoint, so such a request is relayed as it
came, and that endpoint reads proto JSON: an unknown name turns the
whole request away with 400 "Invalid JSON payload received. Unknown
name \"options\": Cannot find field", every call, whatever the effort.
A body relayed to a Gemini OpenAI-compatible upstream (geminiCompat)
now goes without the top-level options, whose runner settings have no
place on a Chat API, as the Ollama route's own body builder already
leaves them out (ollamaChatBody). Another vendor's Chat upstream still
gets the body as the client sent it, and translated requests are
unchanged: they are built from the request's own fields, which never
carried options. geminiCompat is worked out once where the thought
signatures ask for it too.
Run: TestGeminiCompatRelayLeavesOutOllamaOptions fails on the old code
with "Ollama's options reached Gemini's OpenAI-compatible API" and
passes with the change; a request to another vendor's Chat upstream
still carries options there. go test ./internal/gateway/ ok (346.6s);
go test ./... -timeout 45m: 66 packages ok, internal/agent TestMothX
and internal/gui TestProxyCheckSaysAProxyPassedBy red, both red with
the change stashed on f5b01574 too (this machine's, not this change's);
gofmt -l clean; go vet ./... exits 0 (a cgo warning in internal/gui is
the baseline's); GOOS=linux GOARCH=amd64 go vet -tags nogui ./... and
GOOS=windows GOARCH=amd64 go vet ./... clean (GOOS=linux/darwin vet of
the gui fails in wails v3 beta on the baseline too); go build (darwin
arm64), GOOS=windows GOARCH=amd64 and GOOS=linux GOARCH=amd64
-tags nogui builds ok (a plain GOOS=linux/darwin build fails inside
wails v3 beta on the baseline too). Not tried against Google's real
endpoint: the reporter's 400 names the unknown field, and the fake
upstream checks what it is sent.
Generated-by: GLM-5.3-Flash (ZCode)