Repository navigation
fix(drift): accept Gemini's current unauthenticated response in the PR delta gate - #609
Merged
Merged
Conversation
…R delta gate Google's gateway now alternates between two exact 403 PERMISSION_DENIED bodies for unauthenticated Gemini calls: the old 'Method doesn't allow unregistered callers' message, and 'Permission denied on the service.' with an error.details array (ErrorInfo ACCESS_DENIED + LocalizedMessage). The retained-policy check only accepted the first, so drift-live-pr threw on every PR once the second appeared. Accept exactly those two bodies; aimock's local 401 contract and the retained divergence are unchanged.
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
drift-live-pr> "Delta gate" throwsUnexpected retained-policy Gemini gateway responseon PRs. It failed on #605 and on both attempts of #606 (run 42697621424). The sameclassifyNativecheck also runs in the scheduled job.The gate allowed only one exact real Gemini unauthenticated body. Google's gateway now returns two bodies, and they alternate:
Old (seen Nov 7 10:07 PM PST scheduled, and again Nov 9 10:30 PM PST in run 42768299471):
{"status":403,"body":{"error":{"code":403,"status":"PERMISSION_DENIED","message":"Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API."}}}New (seen in run 42697621424 attempts 1 and 2 on Nov 9 at 1:01 PM and 1:13 PM PST, and in the scheduled run 42766538763 on Nov 9 at 10:13 PM PST):
{"status":403,"body":{"error":{"code":403,"status":"PERMISSION_DENIED","message":"Permission denied on the service.","details":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"ACCESS_DENIED","domain":"googleapis.com","metadata":{"service":"generativelanguage.googleapis.com"}},{"@type":"type.googleapis.com/google.rpc.LocalizedMessage","locale":"en-US","message":"Permission denied on the service."}]}}}The status,
error.code, anderror.statusdid not change. The new body has a different message and addserror.details.Fix
The gate now accepts exactly these two documented bodies (deep-equal) and nothing else. aimock's local 401
UNAUTHENTICATEDcontract stays the same, and so does the retainedGemini native authentication/inbound policy divergenceentry.Red/green (real gate script extracted from the workflow, run on the captured run artifacts in delta mode)
Error: Unexpected retained-policy Gemini gateway response, exit 1Drift gate PASSED, exit 0Drift gate PASSED, exit 0errorkeysrc/__tests__/native-cursor-workflow.test.tsgets new cases that run the real workflow gate. The current body is accepted in scheduled and delta modes; this fails on main and passes here. A server error, an extra error key, or a changed message is still rejected.