Merge pull request #1174 from lieyan666/fix/issue-1082-change-error-status-code

fix: change HTTP status code from 400 to 502 when no provider available
This commit is contained in:
Luis Pater
2026-02-01 07:10:52 +08:00
committed by GitHub

View File

@@ -651,7 +651,7 @@ func (h *BaseAPIHandler) getRequestDetails(modelName string) (providers []string
}
if len(providers) == 0 {
return nil, "", &interfaces.ErrorMessage{StatusCode: http.StatusBadRequest, Error: fmt.Errorf("unknown provider for model %s", modelName)}
return nil, "", &interfaces.ErrorMessage{StatusCode: http.StatusBadGateway, Error: fmt.Errorf("unknown provider for model %s", modelName)}
}
// The thinking suffix is preserved in the model name itself, so no