Skip to content

fix(agent): ensure fallback clients honor Vertex AI selection#129

Merged
Iamsdt merged 1 commit into
mainfrom
128-agent-fallback-model-path-drops-use_vertex_ai-causing-401-unauthenticated-on-gemini-vertex-setups
May 30, 2026
Merged

fix(agent): ensure fallback clients honor Vertex AI selection#129
Iamsdt merged 1 commit into
mainfrom
128-agent-fallback-model-path-drops-use_vertex_ai-causing-401-unauthenticated-on-gemini-vertex-setups

Conversation

@Iamsdt

@Iamsdt Iamsdt commented May 30, 2026

Copy link
Copy Markdown
Collaborator

This pull request improves the handling of fallback LLM clients in the agent execution flow, ensuring that configuration for Vertex AI is consistently applied across both primary and fallback clients. The changes make the use_vertex_ai flag available throughout the agent and its execution mixin, and update the fallback client creation logic to respect this setting.

Vertex AI configuration consistency:

  • The use_vertex_ai flag is now stored as an instance variable in MyState so that it can be accessed when creating fallback clients, ensuring consistent Vertex AI usage.
  • The AgentExecutionMixin declares the use_vertex_ai attribute so it can be referenced during fallback client creation, even though it is only set by the main agent.
  • When building fallback clients in _call_llm_with_retry, the code now passes the use_vertex_ai flag to _create_client, ensuring fallback clients honor the same Vertex AI selection as the primary client.

Fallback client creation improvements:

  • The fallback client creation logic in _call_llm_with_retry is updated to always pass the correct base_url (previously could be None), improving consistency in client configuration.

@codecov

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Iamsdt Iamsdt merged commit 852e111 into main May 30, 2026
6 checks passed
@Iamsdt Iamsdt deleted the 128-agent-fallback-model-path-drops-use_vertex_ai-causing-401-unauthenticated-on-gemini-vertex-setups branch May 30, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent fallback model path drops use_vertex_ai, causing 401 UNAUTHENTICATED on Gemini Vertex setups

1 participant