Skip to content

fix(antigravity): keep streaming request uploads replayable - #15033

Merged
diegosouzapw merged 5 commits into
diegosouzapw:release/v3.8.51from
mdigitalbh81:fix/antigravity-replayable-request-body-oom-20260929
Sep 29, 2026
Merged

diegosouzapw merged 5 commits into
diegosouzapw:release/v3.8.51from
mdigitalbh81:fix/antigravity-replayable-request-body-oom-20260929

Conversation

@mdigitalbh81

Copy link
Copy Markdown
Contributor

Summary

  • Send Antigravity's finite JSON request payload as a normal replayable string even when the upstream response is streamed.
  • Remove the one-shot ReadableStream + duplex: "half" upload path from the primary send, the 403 retry, and the Google One AI credits retry.
  • Keep response streaming unchanged.

This PR is intentionally scoped only to the request-upload behavior. It does not include memory tracing, stream-backpressure experiments, header changes, or account-rotation changes used during diagnosis.

Related Issues

#5770 correctly prevents retry/fallback of a non-replayable request body. This PR fixes the Antigravity caller side: the payload is already a complete serialized JSON string, so it does not need to be converted into a non-replayable request stream.

Validation

  • Change type: provider
  • Reconciled with current release/v3.8.51
  • Production-code changes include automated regression tests
  • CI / focused checks
  • npm run lint

Production canary validation used large Native Codex / Responses requests with approximately 5.8M serialized request characters. Before this change, the streamed request-upload path reproduced runaway RSS approaching 20 GB and host OOM. With the fixed request body, three sequential requests completed with HTTP 200 while RSS remained roughly 1.6-1.85 GB.

The canary included temporary memory tracing; that instrumentation is deliberately excluded from this PR.

Tests Added Or Updated

  • tests/unit/executor-antigravity.test.ts
    • streaming sends use a fixed string body with no duplex
    • the 403 retry reuses the replayable body
    • the Google One AI credits retry uses the same replayable body

Reviewer Notes

  • No migrations.
  • No settings changes.
  • Response streaming behavior is unchanged.
  • stream continues to control response handling; it no longer changes the finite JSON upload into a ReadableStream.

The two new regressions pushed tests/unit/executor-antigravity.test.ts past the
1200-line test-file cap; they now live in
tests/unit/antigravity-replayable-request-body.test.ts. The now-unused stream
parameter of sendAntigravityRequest is renamed to _stream so eslint passes.
@diegosouzapw
diegosouzapw merged commit 097429f into diegosouzapw:release/v3.8.51 Sep 29, 2026
11 of 16 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