#7751·sub2api

Antigravity MALFORMED_FUNCTION_CALL empty stream retries the same account, then finishes as HTTP 200 after keepalive

Author: ResidualBloodCreated Sep 30, 2026Updated Sep 30, 2026

Summary

0.2.10 already contains #7607. A MALFORMED_FUNCTION_CALL stream that contains only thoughtSignature is correctly classified as an empty stream and failed over. What remains is that this error is RetryableOnSameAccount, and once the 15s pre-content keepalive has committed HTTP 200, the exhausted failover is written back as an SSE empty_stream on that 200. Downstream gateways treat the EOF as success.

Environment

  • Image: weishaw/sub2api:0.2.10
  • Revision: 2f3fed2fdb0787141294cec81487a5df30426f7f
  • Ingress: POST /v1/chat/completions, stream: true
  • Model: gemini-3.8-flash-tiered (Antigravity, reasoning medium)
  • Upstream: /v1internal:streamGenerateContent via daily-cloudcode-pa.googleapis.com

Evidence

A stream opened between 2026-09-30 05:11:11Z–05:13:01Z.

Every attempt returned the same shape: finishReason=MALFORMED_FUNCTION_CALL, content was a single thoughtSignature, no text and no functionCall.

time (CST) action
13:11:23 account 5 empty stream, same-account retry 1/3, upstream 502
13:11:30 account 5 retry 2/3
13:11:38 account 5 retry 3/3
13:11:48 switch to account 3
13:11:55 / 13:12:00 / 13:12:05 account 3 retry 1–3/3
13:12:13 switch to account 4
13:12:21 / 13:12:30 / 13:12:39 account 4 retry 1–3/3
13:13:01 account 4 still empty; gateway.cc.forward_failed: empty Antigravity compatibility stream after keepalive

The client connection stayed open for 109939 ms and completed with HTTP 200. No usage_logs row was written. The downstream gateway recorded end_reason=eof, completion_tokens=0, and billed the request as success. The client (opencode) then surfaced {"message":"empty_stream","type":"upstream_error"}.

The proxy was healthy: the same account served gemini-3.8-flash-low successfully in the same minute. All three Antigravity accounts produced the identical malformed packet, so the same-account retries did not change the outcome.

Expected

  • MALFORMED_FUNCTION_CALL with no text and no function call should not be RetryableOnSameAccount. Switch accounts immediately.
  • If failover is exhausted after the pre-content keepalive has already committed HTTP 200, do not finish that 200 stream with an SSE error that downstream proxies count as success. Fail before any 200 byte is written, or surface a status downstream gateways treat as failure.
  • A real text or tool-call stream should keep the current behavior.

Related

  • #7081 / #7607 fixed the misclassification of signature-only streams as end_turn. This report is the remaining failover and committed-200 behavior on 0.2.10.
  • #7459 and #7098 are different approaches and do not cover this.