mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
fix: skip OAuth token refresh for Azure Anthropic endpoints — prevents ~/.claude/.credentials.json from overwriting Azure key mid-session
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user