This is an automated email from the ASF dual-hosted git repository.

hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git


The following commit(s) were added to refs/heads/master by this push:
     new 3707f8b  fix: remove unsupported claude and gemini channel types
3707f8b is described below

commit 3707f8b02f21a6a8df9abefffdfd32c4c9782eef
Author: Yang Luo <[email protected]>
AuthorDate: Tue Aug 18 18:17:14 2026 +0800

    fix: remove unsupported claude and gemini channel types
---
 controllers/proxy.go       |  4 ++--
 object/channel.go          | 20 +++++++++-----------
 web/src/ChannelEditPage.js | 13 -------------
 web/src/ChannelListPage.js |  2 --
 4 files changed, 11 insertions(+), 28 deletions(-)

diff --git a/controllers/proxy.go b/controllers/proxy.go
index 1faf1d5..892d29a 100644
--- a/controllers/proxy.go
+++ b/controllers/proxy.go
@@ -300,8 +300,8 @@ func isRetryableStatus(statusCode int) bool {
 // channelUnusableReason reports why the proxy cannot forward to a channel, or
 // an empty string when it can.
 func channelUnusableReason(channel *object.Channel) string {
-       if !object.IsChannelOpenAiCompatible(channel) {
-               return fmt.Sprintf("the %s channel type is not supported yet in 
this stage", channel.Type)
+       if !object.IsChannelTypeSupported(channel) {
+               return fmt.Sprintf("the %s channel type is not supported", 
channel.Type)
        }
        if channel.BaseUrl == "" {
                return "channel base URL is not configured"
diff --git a/object/channel.go b/object/channel.go
index 1a13e14..a638b47 100644
--- a/object/channel.go
+++ b/object/channel.go
@@ -44,18 +44,16 @@ const (
 )
 
 var (
-       channelTypes    = []string{"openai", "claude", "gemini", "custom"}
+       // The OpenAI HTTP API is the only wire format the gateway can talk, so
+       // every supported type is reached with an OpenAI-formatted request.
+       channelTypes    = []string{"openai", "custom"}
        channelStatuses = []string{"enabled", "disabled"}
-       // openAiCompatibleChannelTypes are the types whose upstream speaks the
-       // OpenAI HTTP API, which is the only wire format the gateway can talk 
so
-       // far. The claude and gemini types need their own request translation.
-       openAiCompatibleChannelTypes = []string{"openai", "custom"}
 )
 
-// IsChannelOpenAiCompatible reports whether the channel's upstream can be
-// reached with an OpenAI-formatted request.
-func IsChannelOpenAiCompatible(channel *Channel) bool {
-       return containsString(openAiCompatibleChannelTypes, channel.Type)
+// IsChannelTypeSupported reports whether the gateway can talk to the channel's
+// upstream.
+func IsChannelTypeSupported(channel *Channel) bool {
+       return containsString(channelTypes, channel.Type)
 }
 
 func containsString(values []string, value string) bool {
@@ -281,8 +279,8 @@ func TestChannelConnectivity(channel *Channel) (bool, int, 
string) {
                return false, 0, "the channel does not exist"
        }
 
-       if !IsChannelOpenAiCompatible(stored) {
-               return false, 0, fmt.Sprintf("the %s channel type is not 
supported yet in this stage", stored.Type)
+       if !IsChannelTypeSupported(stored) {
+               return false, 0, fmt.Sprintf("the %s channel type is not 
supported", stored.Type)
        }
 
        if stored.BaseUrl == "" {
diff --git a/web/src/ChannelEditPage.js b/web/src/ChannelEditPage.js
index eb899bc..ae22eec 100644
--- a/web/src/ChannelEditPage.js
+++ b/web/src/ChannelEditPage.js
@@ -24,14 +24,9 @@ const {Option} = Select;
 // Hard-coded presets for milestone 1.1 (per channel type).
 const BASE_URL_PRESETS = {
   openai: ["https://api.openai.com/v1";],
-  claude: ["https://api.anthropic.com/v1";],
-  gemini: ["https://generativelanguage.googleapis.com/v1beta";],
   custom: ["https://oneapi.example.com";, "https://api.deepseek.com/v1";, 
"https://api.moonshot.cn/v1";],
 };
 
-// The types the gateway forwards as OpenAI-formatted requests.
-const OPENAI_COMPATIBLE_TYPES = ["openai", "custom"];
-
 // Mirrors object.BuildOpenAiUrl on the server.
 function buildOpenAiUrl(baseUrl, endpoint) {
   let url;
@@ -58,8 +53,6 @@ function buildOpenAiUrl(baseUrl, endpoint) {
 
 const MODEL_PRESETS = {
   openai: ["gpt-5.5", "gpt-5", "gpt-5-mini", "o3", "o4-mini"],
-  claude: ["claude-sonnet-5", "claude-opus-4-8", "claude-haiku-4-5"],
-  gemini: ["gemini-3.6-flash", "gemini-3.5-flash-lite", "gemini-2.5-pro"],
   custom: ["deepseek-chat", "deepseek-reasoner", "moonshot-v1-8k", "qwen-max"],
 };
 
@@ -135,10 +128,6 @@ class ChannelEditPage extends React.Component {
   }
 
   renderUpstreamUrl(channel) {
-    if (!OPENAI_COMPATIBLE_TYPES.includes(channel.type)) {
-      return null;
-    }
-
     const upstreamUrl = buildOpenAiUrl(channel.baseUrl, "/chat/completions");
     if (upstreamUrl === "") {
       return null;
@@ -224,8 +213,6 @@ class ChannelEditPage extends React.Component {
               }}
             >
               <Option value="openai">OpenAI</Option>
-              <Option value="claude">Claude (Anthropic)</Option>
-              <Option value="gemini">Gemini (Google)</Option>
               <Option value="custom">Custom</Option>
             </Select>
           </Col>
diff --git a/web/src/ChannelListPage.js b/web/src/ChannelListPage.js
index c60ba00..53760c7 100644
--- a/web/src/ChannelListPage.js
+++ b/web/src/ChannelListPage.js
@@ -105,8 +105,6 @@ class ChannelListPage extends BaseListPage {
   renderTypeTag(type) {
     const colorMap = {
       openai: "#10a37f",
-      claude: "#d97757",
-      gemini: "#4285f4",
       custom: "#8b5cf6",
     };
     return (


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to