mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-27 00:20:55 +08:00
fix(providers): disable model test for third-party Claude providers
Most third-party Claude Code providers now reject requests from non-official clients, so the model test button would just produce noisy failures (or worse, trigger risk controls on the provider side). Treat third-party Claude providers the same way as official / Copilot / Codex OAuth: pass onTest=undefined so ProviderActions renders the test button in its existing disabled visual state.
This commit is contained in:
@@ -191,6 +191,8 @@ export function ProviderCard({
|
||||
appId === "hermes" && isHermesReadOnlyProvider(provider.settingsConfig);
|
||||
const isCodexOauth =
|
||||
provider.meta?.providerType === PROVIDER_TYPES.CODEX_OAUTH;
|
||||
const isClaudeThirdParty =
|
||||
appId === "claude" && provider.category === "third_party";
|
||||
|
||||
// 获取用量数据以判断是否有多套餐
|
||||
// 累加模式应用(OpenCode/OpenClaw/Hermes):使用 isInConfig 代替 isCurrent
|
||||
@@ -467,7 +469,11 @@ export function ProviderCard({
|
||||
onEdit={() => onEdit(provider)}
|
||||
onDuplicate={() => onDuplicate(provider)}
|
||||
onTest={
|
||||
onTest && !isOfficial && !isCopilot && !isCodexOauth
|
||||
onTest &&
|
||||
!isOfficial &&
|
||||
!isCopilot &&
|
||||
!isCodexOauth &&
|
||||
!isClaudeThirdParty
|
||||
? () => onTest(provider)
|
||||
: undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user