File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1724,12 +1724,29 @@ export function getSubscriptionName(): string {
17241724 }
17251725}
17261726
1727- /** Check if using third-party services (Bedrock or Vertex or Foundry) */
1727+ /**
1728+ * Check if using third-party services (non-Anthropic providers).
1729+ *
1730+ * This function gates several behaviours that should only apply when the user
1731+ * is NOT calling the first-party Anthropic API directly:
1732+ * - auth status display (authStatus handler)
1733+ * - command visibility (login/logout shown for non-3P)
1734+ * - command availability checks (meetsAvailabilityRequirement)
1735+ *
1736+ * KEEP IN SYNC with providers.ts — when a new CLAUDE_CODE_USE_* env var is
1737+ * added to getAPIProvider(), the corresponding check MUST be added here.
1738+ * Providers whose selection is controlled purely via settings.modelType
1739+ * (rather than env vars) are NOT covered by this function and may need
1740+ * separate handling in the call sites above.
1741+ */
17281742export function isUsing3PServices ( ) : boolean {
17291743 return ! ! (
17301744 isEnvTruthy ( process . env . CLAUDE_CODE_USE_BEDROCK ) ||
17311745 isEnvTruthy ( process . env . CLAUDE_CODE_USE_VERTEX ) ||
1732- isEnvTruthy ( process . env . CLAUDE_CODE_USE_FOUNDRY )
1746+ isEnvTruthy ( process . env . CLAUDE_CODE_USE_FOUNDRY ) ||
1747+ isEnvTruthy ( process . env . CLAUDE_CODE_USE_OPENAI ) ||
1748+ isEnvTruthy ( process . env . CLAUDE_CODE_USE_GEMINI ) ||
1749+ isEnvTruthy ( process . env . CLAUDE_CODE_USE_GROK )
17331750 )
17341751}
17351752
You can’t perform that action at this time.
0 commit comments