Repository navigation
feat(fakes): add mock Gemini inference server - #6
Merged
Merged
Conversation
This was referenced Nov 13, 2026
Lukeluds
force-pushed
the
feat/mock-gemini-core
branch
from
November 16, 2026 23:07
4b72ed2 to
7ae18f3
Compare
mayawang
approved these changes
Nov 16, 2026
mayawang
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, nice parity with mock-anthropic, and stricter on scrubbing the key. Non-blocking, fine as follow-ups: a missing key returns 401 but I think real Gemini gives 403 PERMISSION_DENIED; streamGenerateContent without alt=sse returns SSE where the real API returns a JSON array; and GET models/{name} gets the list response instead of a single Model.
5 tasks
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.
Adds
fakes/mock-gemini, a standard-library Python HTTP fake for the Gemini API (generativelanguage.googleapis.com).Running this fake outside the sandbox lets E2E tests verify Antigravity CLI (
agy) task execution, egress rules, and gateway credential injection without live API keys or model spend:x-goog-api-key,?key=, andAuthorization: BeareragainstEXPECTED_KEY(401when missing,400on mismatch).:streamGenerateContent?alt=sse) and JSON (:generateContent) replies, plus/v1beta/modelsand:countTokens.GET /_mock/requests(with secret headers and?key=redacted) andPOST /_mock/resetfor test assertions.fakes/mock-gemini/selftest.shand a container build/smoke check into CI.Fault injection modes and scripted
write_filefunctionCallturns follow in a stacked PR.