Skip to content

feat(fakes): add fault injection and scripted write_file functionCall to mock-gemini - #7

Merged
Lukeluds merged 1 commit into
agentexecutor:mainfrom
Lukeluds:feat/mock-gemini-faults-tools
Nov 24, 2026
Merged

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

Conversation

@Lukeluds

@Lukeluds Lukeluds commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Note: Stacked on #6 (see commit 128c794 for only this PR's diff; the PR diff will shrink automatically once #6 merges).

Extends fakes/mock-gemini with runtime fault injection and multi-turn write_file functionCall scripting for Antigravity (agy) E2E testing:

  • Fault modes (FAULT env or POST /_mock/config): 429 (rate limit with Retry-After: 1), 500 (internal error), 503 (UNAVAILABLE for retry testing), slow (delayed JSON/SSE), and truncated_sse (streaming requests get a cut-off SSE chunk; non-streaming :generateContent gets a 200 JSON body cut off mid-way).
  • Scripted write_file functionCall (TOOL_WRITE_PATH / TOOL_WRITE_CONTENT): Turn 1 emits a write_file functionCall only when write_file is declared in tools (tool-less side requests receive plain text); Turn 2 (once functionResponse is returned) replies with REPLY_TEXT.
  • Runtime configuration (POST /_mock/config): Validates keys, fault values, and slow_delay (finite number >= 0, rejecting booleans) before acquiring the lock so invalid requests return 400 without partial state updates; resets on POST /_mock/reset.
  • Expands fakes/mock-gemini/selftest.sh to cover all fault modes, non-streaming truncated JSON, tool-less probes, config validation, and 2-turn write_file functionCall.

mayawang
mayawang previously approved these changes Nov 16, 2026

@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. Non-blocking: worth confirming the scripted write_file arg names (Path/Content/Overwrite) against a real agy request; the 429 uses Retry-After, while google-genai reads RetryInfo.retryDelay from error.details, so a backoff test may not hit the real path; and tool_write_path/content aren't type-checked in /_mock/config.

@Lukeluds
Lukeluds dismissed mayawang’s stale review November 17, 2026 00:28

The merge-base changed after approval.

@Lukeluds

Lukeluds commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Thanks! Pushed two quick updates (sorry for resetting the approval stamp and that this comment is supposed to be sent at pr 10 instead of here):

  • Added an opt-in run_real_gemini_e2e.sh that runs the hero-demo prompt against real generativelanguage.googleapis.com over Substrate's HTTPS/egress-CA path + x-goog-api-key secret injection (verified passing locally on KinD; also confirmed agy uses Path/Content/Overwrite for write_file).

  • Dropped 2>&1 on kubectl-ate create/resume in run_e2e.sh so errors print to stderr instead of failing silently.

mayawang
mayawang previously approved these changes Nov 17, 2026

@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.

Thanks for confirming the arg names! Still LGTM.

@Lukeluds
Lukeluds dismissed mayawang’s stale review November 17, 2026 01:34

The merge-base changed after approval.

@Lukeluds
Lukeluds force-pushed the feat/mock-gemini-faults-tools branch from 128c794 to 3c29cbc Compare November 17, 2026 19:08
@Lukeluds

Copy link
Copy Markdown
Collaborator Author

Rebased onto main after #6 merged, since GitHub kept auto-dismissing the approval because of the old merge-base. The code hasn't changed. Mind re-stamping when you get a chance?

@MushuEE

MushuEE commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Tracking: mock-gemini is one of the images published under the release epic #12, and this change supports the Antigravity E2E in #10. It isn't a prerequisite for the first release.

@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.

Re-stamping LGTM after the rebase.

@Lukeluds
Lukeluds merged commit 11bfcf8 into agentexecutor:main Nov 24, 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.

3 participants