Files
magpie/docs
yetone b2c97659fb gateway: a model picked for Responses is asked on Responses again after the relay once answers it there with "use /v1/chat/completions", not sent as chat from then on (01huadalang on Discord: 为什么会转成 chat,我都设置的 response)
A wrong-endpoint answer marks the model unfit on that API until magpie
restarts. With the user's per-model API (Names & levels, ModelAPI) the
only API usable gives, one such answer left usable empty, and every later
request fell back to p.Speaks(): chat first. Now the fallback is the
picked API; without a pick it is Speaks() as before.

TestModelAPIPickHoldsAfterWrongEndpoint (a relay with chat and Responses
URLs, the model picked for Responses, its first Responses answer a 400
"not supported in /v1/responses, use /v1/chat/completions"; a Responses
and a chat client each send twice) fails on the old code (the second
request goes to /v1/chat/completions, upstream [/v1/responses
/v1/chat/completions ...]) and passes with the change. go test -tags
nogui -count=1 ./internal/gateway under a temp HOME passes; go vet
(darwin, GOOS=linux, GOOS=windows) on ./internal/gateway passes. Not
confirmed that this is the reporter's case: their provider and request
weren't seen.
2026-10-09 01:24:47 +08:00
..