Skip to content

feat(fakes): add mock Gemini inference server - #6

Merged
Lukeluds merged 1 commit into
agentexecutor:mainfrom
Lukeluds:feat/mock-gemini-core
Nov 17, 2026
Merged

Lukeluds merged 1 commit into
agentexecutor:mainfrom
Lukeluds:feat/mock-gemini-core

Conversation

@Lukeluds

Copy link
Copy Markdown
Collaborator

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:

  • Validates x-goog-api-key, ?key=, and Authorization: Bearer against EXPECTED_KEY (401 when missing, 400 on mismatch).
  • Supports streaming SSE (:streamGenerateContent?alt=sse) and JSON (:generateContent) replies, plus /v1beta/models and :countTokens.
  • Exposes GET /_mock/requests (with secret headers and ?key= redacted) and POST /_mock/reset for test assertions.
  • Wires fakes/mock-gemini/selftest.sh and a container build/smoke check into CI.

Fault injection modes and scripted write_file functionCall turns follow in a stacked PR.

@Lukeluds
Lukeluds force-pushed the feat/mock-gemini-core branch from 4b72ed2 to 7ae18f3 Compare November 16, 2026 23:07

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@Lukeluds
Lukeluds merged commit 587cee8 into agentexecutor:main Nov 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants