fix(models): the judge's Vertex client uses ADC even when agent API keys are set - #81
fix(models): the judge's Vertex client uses ADC even when agent API keys are set#81geojaz wants to merge 2 commits into
Conversation
…e in the environment
The judge failed 401 UNAUTHENTICATED against aiplatform.googleapis.com
("API keys are not supported by this API") even with valid ADC on the
host. google-genai's Vertex mode silently prefers API-key/express auth
over Application Default Credentials whenever GOOGLE_API_KEY or
GEMINI_API_KEY is present in the environment, and those are exactly the
variables exported for the sandboxed coding agent this judge scores.
Resolving credentials explicitly via google.auth.default() and handing
them to genai.Client(..., credentials=...) closes that path: the client
can no longer fall back to an env API key it was never told to look for.
Signed-off-by: Eric Hole <ehole@onixnet.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: geojaz The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 59 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @geojaz. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
test_get_model_resolves_gemini_aliases reaches the new Vertex ADC path via the google-vertex/google_vertex provider aliases and was doing a real credentials lookup in CI. Mock google_auth.default there like the other Vertex-path tests. Also reorders the try-block imports in gemini.py so isort/ruff stops flagging the plain import.
The judge's Vertex client was picking up an agent's API key from the environment instead of using application default credentials.
This matters because the agent under evaluation and the judge scoring it are not the same principal and should not share credentials. When an agent API key was present in the environment, the judge would authenticate as that agent, which both crosses an isolation boundary and fails in any setup where the agent key has no access to the judge's model.
The judge now resolves credentials through ADC regardless of what agent keys are in the environment.