fix: allow provider switch without proxy, show warning instead of blocking

Remove the hard block that prevented switching to providers requiring
proxy (OpenAI format, Copilot, full URL mode) when the proxy is not
running. Now the switch proceeds with a warning toast. Also deduplicate
the proxy hint info toast so it doesn't appear alongside the warning.
This commit is contained in:
Jason
2026-04-05 09:39:51 +08:00
parent 159279bf44
commit 8d38f0ee4f
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -183,7 +183,6 @@ export function useProviderActions(activeApp: AppId, isProxyRunning?: boolean) {
"此供应商{{reason}},需要代理服务才能正常使用,请先启动代理",
}),
);
return;
}
try {
@@ -203,13 +202,14 @@ export function useProviderActions(activeApp: AppId, isProxyRunning?: boolean) {
// 根据供应商类型显示不同的成功提示
if (
!proxyRequiredReason &&
activeApp === "claude" &&
provider.category !== "official" &&
(isCopilotProvider ||
provider.meta?.apiFormat === "openai_chat" ||
provider.meta?.apiFormat === "openai_responses")
) {
// OpenAI format provider: show proxy hint
// OpenAI format provider: show proxy hint (skip if warning already shown)
toast.info(
isCopilotProvider
? t("notifications.copilotProxyHint")