fix(translator): honor APIKeyPassthrough for Gemini provider#2042
fix(translator): honor APIKeyPassthrough for Gemini provider#2042mesutoezdil wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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
APIKeyPassthroughis enabled (and only mount the secret when passthrough is off and a secret is configured). - Ensure the translated
adk.Geminimodel config reflectsapi_key_passthrough.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adb6fd6 to
ce7e91f
Compare
EItanya
left a comment
There was a problem hiding this comment.
Makes sense, is passthrough implemented for Gemini in our adk + adk go?
hm not fully. the python adk has the api_key_passthrough field on kagentgeminillm but is missing set_passthrough_key(), so llmassthroughplugin skips gemini at runtime. go adk has no gemini model implementation at all. my pr fixes the translator side only. |
If this doesn't fully work then can we add those fixes? |
4781a44 to
4a2fc83
Compare
done |
How can this be true, seems like a bigger issue than passthrough in python |
correction: Go ADK does have Gemini (agent.go:215). What's missing is passthrough support there. it always requires env vars regardless of ApiKeyPassthrough. This PR covers translator + Python ADK; Go ADK passthrough is a separate follow-up. |
59391cd to
dc85583
Compare
1463b54 to
1e3c8e6
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
881114b to
ca8cd8a
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
ca8cd8a to
8b7d9f3
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
8b7d9f3 to
87ffd2d
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
87ffd2d to
f83247b
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
f83247b to
af41527
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
eb645d4 to
4d5de3f
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
4d5de3f to
819aea7
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
819aea7 to
7beddf6
Compare
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
7beddf6 to
bbade9d
Compare
- skip Google API key secret mount when passthrough is enabled - set api_key_passthrough on adk.Gemini model struct - implement set_passthrough_key on KAgentGeminiLlm so LLMPassthroughPlugin works at runtime Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
…hcr.io cr.kagent.dev was removed in kagent-dev#2177; the golden file still referenced the old alias, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
bbade9d to
3e3e145
Compare
cr.kagent.dev was removed in kagent-dev#2177, and the app image tag changed to app:dev. The golden file still had both old values, which caused go-unit-tests to fail on PR kagent-dev#2042. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
3e3e145 to
240dc7d
Compare
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
APIKeyPassthroughon the ADK model struct.All other providers (OpenAI, Anthropic, AzureOpenAI, Ollama) already handle this correctly.