diff --git a/run_agent.py b/run_agent.py index 70d9a84b06..ea1ea4af6b 100644 --- a/run_agent.py +++ b/run_agent.py @@ -5471,6 +5471,11 @@ class AIAgent: # Other anthropic_messages providers (MiniMax, Alibaba, etc.) use their own keys. if self.provider != "anthropic": return False + # Azure endpoints use static API keys — OAuth token rotation doesn't apply. + # Refreshing would pick up ~/.claude/.credentials.json OAuth token and break auth. + _base = getattr(self, "_anthropic_base_url", "") or "" + if "azure.com" in _base: + return False try: from agent.anthropic_adapter import resolve_anthropic_token, build_anthropic_client