Skip to content

fix(translator): honor APIKeyPassthrough for Gemini provider#2042

Open
mesutoezdil wants to merge 2 commits into
kagent-dev:mainfrom
mesutoezdil:fix/gemini-api-key-passthrough
Open

fix(translator): honor APIKeyPassthrough for Gemini provider#2042
mesutoezdil wants to merge 2 commits into
kagent-dev:mainfrom
mesutoezdil:fix/gemini-api-key-passthrough

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

The Gemini provider in the model translator was not checking APIKeyPassthrough.
It always tried to mount the Google API key secret, even when passthrough mode was enabled.
It also never set APIKeyPassthrough on the ADK model struct.
All other providers (OpenAI, Anthropic, AzureOpenAI, Ollama) already handle this correctly.

Copilot AI review requested due to automatic review settings June 17, 2026 21:28
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 17, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Gemini model translation path so it correctly supports APIKeyPassthrough, aligning Gemini with the behavior already implemented for other providers in the ADK agent translator.

Changes:

  • Avoid injecting the Google API key env var/secret ref when APIKeyPassthrough is enabled (and only mount the secret when passthrough is off and a secret is configured).
  • Ensure the translated adk.Gemini model config reflects api_key_passthrough.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread go/core/internal/controller/translator/agent/adk_api_translator.go
@mesutoezdil mesutoezdil force-pushed the fix/gemini-api-key-passthrough branch from a4043fb to 89aa58e Compare June 17, 2026 21:32
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
@mesutoezdil mesutoezdil force-pushed the fix/gemini-api-key-passthrough branch from adb6fd6 to ce7e91f Compare June 17, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants