Issue
When Agent is constructed with use_vertex_ai=True and a fallback_models list, fallback model calls fail with 401 UNAUTHENTICATED. The flag is dropped on (a) the auto-detect client-construction branch in Agent.__init__, and (b) the fallback client construction in execution.py, so the fallback client hits Gemini's public-API endpoint (API-key auth) instead of Vertex (OAuth2/ADC).
Primary model works; only fallbacks fail — making it look like an intermittent Gemini outage rather than an auth wiring bug.
Relevant files
agentflow/core/graph/agent.py — Agent.__init__, around lines 247–285. The else branch calls self._create_client(self.provider, base_url) without use_vertex_ai.
agentflow/core/graph/agent_internal/execution.py — fallback construction at ~line 311 calls self._create_client(provider, base_url) without self.use_vertex_ai.
Fix is to forward use_vertex_ai in both call sites (default False keeps non-Vertex users unaffected). Happy to send a PR.
Issue
When
Agentis constructed withuse_vertex_ai=Trueand afallback_modelslist, fallback model calls fail with401 UNAUTHENTICATED. The flag is dropped on (a) the auto-detect client-construction branch inAgent.__init__, and (b) the fallback client construction inexecution.py, so the fallback client hits Gemini's public-API endpoint (API-key auth) instead of Vertex (OAuth2/ADC).Primary model works; only fallbacks fail — making it look like an intermittent Gemini outage rather than an auth wiring bug.
Relevant files
agentflow/core/graph/agent.py—Agent.__init__, around lines 247–285. Theelsebranch callsself._create_client(self.provider, base_url)withoutuse_vertex_ai.agentflow/core/graph/agent_internal/execution.py— fallback construction at ~line 311 callsself._create_client(provider, base_url)withoutself.use_vertex_ai.Fix is to forward
use_vertex_aiin both call sites (defaultFalsekeeps non-Vertex users unaffected). Happy to send a PR.