From 30b4697a851527480a073267922aacb2d8ccbb98 Mon Sep 17 00:00:00 2001 From: Chang Su Date: Mon, 9 Mar 2026 11:16:14 -0700 Subject: [PATCH] refactor(gateway): remove redundant RoutingMode special-case in connection_mode detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenAI routing mode was hardcoded to ConnectionMode::Http instead of going through determine_connection_mode(). This was a safety measure from the original OpenAI backend PR, but after the gRPC detection was simplified to scheme-only checking (grpc:// or grpcs://), the special case is unnecessary — external provider URLs (https://) always resolve to Http. Removing it prevents each new external provider from needing its own match arm. Signed-off-by: Chang Su --- model_gateway/src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/model_gateway/src/main.rs b/model_gateway/src/main.rs index 7cb1af9d30..45c2ddfc79 100644 --- a/model_gateway/src/main.rs +++ b/model_gateway/src/main.rs @@ -1020,10 +1020,7 @@ impl CliArgs { all_urls.extend(worker_urls.clone()); } } - let connection_mode = match &mode { - RoutingMode::OpenAI { .. } => ConnectionMode::Http, - _ => Self::determine_connection_mode(&all_urls), - }; + let connection_mode = Self::determine_connection_mode(&all_urls); let history_backend = match self.history_backend.as_str() { "none" => HistoryBackend::None,