diff --git a/internal/catalog/catalog.go b/internal/catalog/catalog.go index 5b968ae8c..fdad2610e 100644 --- a/internal/catalog/catalog.go +++ b/internal/catalog/catalog.go @@ -2284,6 +2284,13 @@ func WrongEndpoint(status int, body []byte) bool { // /v1/responses(OpenAI Responses API)。") "不支持 /v1/chat/completions 接口", "改用 /v1/responses", + // a relay's 404 for a model asked on an API it doesn't serve it + // on (equinox0253 on X: WandAPI's "模型 gpt-6.1-sol 不支持当前入口 + // 协议" to Claude Code's /v1/messages). It names the protocol, which + // a 404 for a wrong base URL or a missing model never does. + "不支持当前入口协议", + "不支持该入口协议", + "不支持此入口协议", } { if strings.Contains(msg, phrase) { return true diff --git a/internal/gateway/gateway_test.go b/internal/gateway/gateway_test.go index 950ca587a..464a0efb1 100644 --- a/internal/gateway/gateway_test.go +++ b/internal/gateway/gateway_test.go @@ -444,6 +444,9 @@ func TestWrongEndpoint(t *testing.T) { {400, agentRouterEscaped, true}, // escaped (#1669) {400, `{"error":{"message":"模型 gpt-5.6-sol 不支持 /v1/chat/completions 接口"}}`, true}, // its first clause alone {400, `{"error":{"message":"请改用 /v1/responses(OpenAI Responses API)。"}}`, true}, // its second alone + // WandAPI's 404 (equinox0253 on X), and a missing model's + {404, `{"error":{"message":"模型 gpt-6.1-sol 不支持当前入口协议","type":"new_api_error"}}`, true}, + {404, `{"error":{"message":"模型 gpt-6.1-sol 不存在","type":"new_api_error"}}`, false}, // new-api's words for a model no channel serves (written from // memory, not from the report): the model, not the API {400, `{"error":{"message":"当前分组 default 下对于模型 gone 无可用渠道"}}`, false}, diff --git a/internal/gateway/newapi_no_channel_test.go b/internal/gateway/newapi_no_channel_test.go index d4f447c17..26595efb8 100644 --- a/internal/gateway/newapi_no_channel_test.go +++ b/internal/gateway/newapi_no_channel_test.go @@ -159,6 +159,11 @@ func TestNoChannelAs404FromAFork(t *testing.T) { falls bool }{ {"fork no channel", `{"error":{"message":"分组 default 下模型 gpt-6.1-sol 暂无渠道","type":"new_api_error","code":"model_not_found"}}`, true}, + // WandAPI's own words (equinox0253 on X, 11-13): the protocol + // named, no channel; a wrong endpoint (wrongEndpoint) as the + // tweet's screenshot reads it + {"entry protocol", `{"error":{"message":"模型 gpt-6.1-sol 不支持当前入口协议","type":"new_api_error","code":"model_not_found"}}`, true}, + {"entry protocol, Anthropic's shape", `{"type":"error","error":{"type":"invalid_request_error","message":"模型 gpt-6.1-sol 不支持当前入口协议"}}`, true}, {"missing model", `{"error":{"message":"The model gpt-6.1-sol does not exist or you do not have access to it.","type":"invalid_request_error","code":"model_not_found"}}`, false}, {"wrong base URL", `404 page not found`, false}, } {