fix: skip Anthropic preconnect for third-party providers (#309)
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
import { getOauthConfig } from '../constants/oauth.js'
|
||||
import { isEnvTruthy } from './envUtils.js'
|
||||
import { getAPIProvider } from './model/providers.js'
|
||||
|
||||
let fired = false
|
||||
|
||||
@@ -32,6 +33,11 @@ export function preconnectAnthropicApi(): void {
|
||||
if (fired) return
|
||||
fired = true
|
||||
|
||||
// Third-party providers should not warm a connection to Anthropic.
|
||||
if (getAPIProvider() !== 'firstParty') {
|
||||
return
|
||||
}
|
||||
|
||||
// Skip if using a cloud provider — different endpoint + auth
|
||||
if (
|
||||
isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) ||
|
||||
|
||||
Reference in New Issue
Block a user