mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-02 18:41:35 +08:00
feat(proxy): flag managed-OAuth providers as routing-required
Managed-OAuth providers (github_copilot / codex_oauth / xai_oauth) need proxy takeover to inject credentials, but the "needs routing" badge and the switch-time warning only keyed off apiFormat — missing OAuth providers whose upstream format is native (e.g. the new Codex xAI Grok OAuth preset on openai_responses). - Add isOAuthProviderType / OAUTH_PROVIDER_TYPES as the SSOT for OAuth types - Extract providerNeedsRouting() as the authoritative predicate: managed OAuth always needs routing (the backend rejects these accounts' direct connection) regardless of apiFormat or Claude Desktop mode - ProviderCard badges (claude / codex / claude-desktop) and the switch warning consume the shared predicate instead of raw apiFormat - Gate the warning on per-app routing readiness: claude-desktop uses isProxyRunning (backend takeover status has no such field), other apps use isProxyTakeover — fixes false warnings on Desktop and missing warnings when the proxy runs but the app isn't taken over - Force proxy mode for all managed-OAuth providers in the Claude Desktop form (lock the mode toggle), not only xai_oauth - Add unit tests for providerNeedsRouting, the switch routing gate, and Desktop OAuth preset enforcement - i18n(zh/en/ja/zh-TW): add notifications.proxyReasonManagedOAuth
This commit is contained in:
@@ -259,6 +259,8 @@
|
||||
"proxyReasonOpenAIResponses": "uses OpenAI Responses API format",
|
||||
"proxyReasonAnthropicMessages": "uses Anthropic Messages API format",
|
||||
"proxyReasonFullUrl": "has full URL connection mode enabled",
|
||||
"proxyReasonManagedOAuth": "uses managed OAuth login (token injected by local routing)",
|
||||
"proxyReasonRoutingRequired": "requires local routing to process requests",
|
||||
"openAIFormatHint": "This provider uses OpenAI-compatible format and requires the routing service to be enabled",
|
||||
"copilotProxyHint": "GitHub Copilot as a Claude provider always requires local routing; routing automatically selects Chat Completions or Responses based on the current model.",
|
||||
"openLinkFailed": "Failed to open link",
|
||||
|
||||
@@ -259,6 +259,8 @@
|
||||
"proxyReasonOpenAIResponses": "OpenAI Responses API フォーマットを使用しており",
|
||||
"proxyReasonAnthropicMessages": "Anthropic Messages API フォーマットを使用しており",
|
||||
"proxyReasonFullUrl": "完全 URL 接続モードが有効になっており",
|
||||
"proxyReasonManagedOAuth": "マネージド OAuth ログイン(トークンはローカルルーティングが注入)を使用しており",
|
||||
"proxyReasonRoutingRequired": "リクエスト処理にローカルルーティングが必要であり",
|
||||
"openAIFormatHint": "このプロバイダーは OpenAI 互換フォーマットを使用しており、ルーティングサービスの有効化が必要です",
|
||||
"copilotProxyHint": "GitHub Copilot を Claude プロバイダーとして使用する場合、ローカルルーティングが常に必要です。ルーティングは現在のモデルに応じて Chat Completions または Responses を自動的に選択します。",
|
||||
"openLinkFailed": "リンクを開けませんでした",
|
||||
|
||||
@@ -259,6 +259,8 @@
|
||||
"proxyReasonOpenAIResponses": "使用 OpenAI Responses API 格式",
|
||||
"proxyReasonAnthropicMessages": "使用 Anthropic Messages API 格式",
|
||||
"proxyReasonFullUrl": "開啟了完整 URL 連線模式",
|
||||
"proxyReasonManagedOAuth": "使用託管 OAuth 登入(權杖由本機路由注入)",
|
||||
"proxyReasonRoutingRequired": "需要本機路由處理請求",
|
||||
"openAIFormatHint": "此供應商使用 OpenAI 相容格式,需要開啟路由服務才能正常使用",
|
||||
"copilotProxyHint": "GitHub Copilot 作為 Claude 供應商時始終需要本地路由;路由會根據目前模型自動選擇 Chat Completions 或 Responses。",
|
||||
"openLinkFailed": "連結開啟失敗",
|
||||
|
||||
@@ -259,6 +259,8 @@
|
||||
"proxyReasonOpenAIResponses": "使用 OpenAI Responses 接口格式",
|
||||
"proxyReasonAnthropicMessages": "使用 Anthropic Messages 接口格式",
|
||||
"proxyReasonFullUrl": "开启了完整 URL 连接模式",
|
||||
"proxyReasonManagedOAuth": "使用托管 OAuth 登录(令牌由本地路由注入)",
|
||||
"proxyReasonRoutingRequired": "需要本地路由处理请求",
|
||||
"openAIFormatHint": "此供应商使用 OpenAI 兼容格式,需要开启路由服务才能正常使用",
|
||||
"copilotProxyHint": "GitHub Copilot 作为 Claude 供应商时始终需要本地路由;路由会根据当前模型自动选择 Chat Completions 或 Responses。",
|
||||
"openLinkFailed": "链接打开失败",
|
||||
|
||||
Reference in New Issue
Block a user