From 7bfa9442dea1ece6a6fe8f9564bb384adbf8a508 Mon Sep 17 00:00:00 2001 From: HangGlidersRule <637186+HangGlidersRule@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:06:29 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20skip=20OAuth=20token=20refresh=20for=20A?= =?UTF-8?q?zure=20Anthropic=20endpoints=20=E2=80=94=20prevents=20~/.claude?= =?UTF-8?q?/.credentials.json=20from=20overwriting=20Azure=20key=20mid-ses?= =?UTF-8?q?sion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run_agent.py | 5 +++++ 1 file changed, 5 insertions(+) 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