Files
magpie/docs
yetone 16b8c300fe provider: a Gemini compatible URL saved as a bare host is asked at its /v1beta (equinox0253 on X)
cc0d9c8b0 kept a relay's root typed under "Gemini 兼容" as typed, where it
was saved as …/v1beta before, and requests went to the saved base as it
was. So WandAPI's https://api.wandapi.ai was asked
/models/gemini-3.8-flash:streamGenerateContent?alt=sse with no version, and
the relay refused it (the tweet's second screenshot: Claude Code's
/v1/messages → Gemini, 503).

The saved base stays as typed, and the version is added where a request
goes: provider.GeminiAsked gives a bare host /v1beta, as Google's SDKs add
it to a base_url with no path, and keeps a base with a path of its own
(/v1beta, a relay's /gemini, /proxy/v1) as typed. Base(Gemini) returns it,
so the gateway's requests, the native route and the model list
(catalog.FetchGemini at Base) all take it; a model's test (provider/test.go)
read p.Gemini directly and now reads Base(Gemini) too. The Google preset's
bases already carry /v1beta and are unchanged. docs/subsystems/
providers-accounts.md said GeminiBase adds /v1beta to any bare host, true
before cc0d9c8b0; it now says where the version is added.

Run (mote, -tags nogui, on 5a3f055d7 at origin/main 92bce5c72): the new
TestGeminiBareHostAskedAtV1beta (a fake upstream that answers only at the
expected path; bare host, bare host with a slash, /v1beta, /gemini) red on
the old code (asked /models/gemini-3.8-flash:…, 404), green after; the new
TestGeminiAsked; go test ./internal/gateway ./internal/provider -run
'Gemini|Vertex|OpenCode' ok; go vet darwin, linux, windows on provider,
gateway, catalog; gofmt clean.
Broken by hand: Base(Gemini) and the model test back to p.Gemini: both new
tests red.
Rebased on origin/main 0b38eb21c and run again there (mote, -tags nogui):
go test ./internal/gateway ./internal/provider ./internal/catalog -run
'TestWrongEndpoint$|TestNoChannel|Gemini' ok.
Not tried: a real WandAPI account; the full suite runs after the tag.
2026-11-13 15:59:26 +08:00
..