[Bug]: Antigravity turn ends on a dropped ACP stream: raw proxy error shown, no reconnect after a clean WebSocket close (1000) #11670
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server (Antigravity / ACP provider, session lifecycle and error handling)
Steps to reproduce#
- T3 Code (Alpha)
0.0.40, also seen on0.0.41-nightly.20260913.1675, on macOS. Antigravity provider, Gemini 3.8 Flash. - Run a normal multi-minute turn with several tool calls.
- Partway through, the local Antigravity proxy (
agy_acp_serverathttp://127.0.0.1:<port>) drops the streaming request to the model. - After the turn fails, send the prompt again ("try again" or "continue").
Expected behavior#
- A dropped upstream stream (
streamGenerateContentreturningEOF) should be retried with backoff. - A clean WebSocket close (code
1000 OK) from the ACP process should reconnect, not end the turn. - Any error shown to the user should be readable, not a raw Go transport string.
Actual behavior#
Two problems, both in T3's handling of the drop:
- The raw error reaches the user. When the proxy returns
EOF, the adapter forwards the message unchanged and ends the turn:Agent execution error: model unreachable: doRequest: error sending request: Post "…streamGenerateContent…": EOF. - A clean close is treated as fatal. On the next prompt, the session cannot recover:
Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK). Code1000is a normal close, but the rebuild path fails on it. The user has to start the turn over.
Seen in four real sessions across two builds, three on 0.0.40 (2026-09-10) and one on 0.0.41-nightly.20260913 (2026-09-14), so it survives across releases:
| Session (title) | Build | model unreachable … EOF at | fatal rebuild agent: 1000 (OK) at |
|---|---|---|---|
| Add Usage Summary to Sessions | 0.0.40 | 2026-09-10 08:53:07Z | 2026-09-10 09:03:54Z |
| MCQ Appears Before Merge | 0.0.40 | 2026-09-10 12:41:33Z | 2026-09-10 12:44:25Z |
| Complete Issues and Browser Verification | 0.0.40 | 2026-09-10 12:41:35Z | 2026-09-10 12:44:16Z |
| Assess Vitest 5 Test Breakages | 0.0.41-nightly.20260913 | 2026-09-14 01:24:37Z | 2026-09-14 01:55:05Z |
Likely code areas#
References are pinned to commit c07575f573dd3a1af4f734297d17f7c951c95f10 (main), so the line numbers stay valid as the file changes. Neither error string exists in the source, so both come from the agy_acp_server binary and pass through unclassified. The handling gaps are:
AcpAdapterSupport.tsL30-L43 (mapAcpToAdapterError): setsdetail: error.messagewith no branch for transient or network errors, so the raw proxy string reaches the chat.AcpSessionRuntime.tsL363-L374 (ensureConnected): does not reconnect. It only re-throws a stored termination error.recordTerminationL376-L392 latches the first failure, andretireRuntimeL912-L917 kills the child process, so the runtime cannot recover on its own.AntigravityAdapter.ts: no retry, backoff, or reconnect around the prompt. The prompt is dispatched once.- The only recovery path is a full instance rebuild in
ProviderInstanceRegistry.ts, which re-runs the ACP handshake. A clean WebSocket close during that handshake is what surfaces asFailed to rebuild agent: received 1000 (OK).
Impact#
A recoverable disconnect ends the turn and makes the user re-send the prompt. The message says model unreachable, so users assume the model or network is down, when it is the local proxy dropping the stream.
Version or commit#
T3 Code (Alpha) 0.0.40, still reproducing on 0.0.41-nightly.20260913.1675.
Environment#
- macOS 26.5.2 (Build 25F84, arm64)
- Antigravity provider via the local
agy_acp_serverproxy athttp://127.0.0.1:<port> - Model:
gemini-3.8-flash-high
Logs or stack traces#
Assistant-surfaced errors, with the GCP project id and the ephemeral port masked:
Agent execution error: model unreachable: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
Agent connection was lost and could not be re-established: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
Full provider event logs are available on request at ~/.t3/userdata/logs/provider/events.<thread>.log for the four sessions above. Scrub <project-id> before sharing.
Workaround#
Send the prompt again. This usually starts a fresh agent. There is no automatic retry or reconnect.
Scrubbed per-session evidence (rendered errors + one raw provider event each)
PII masked: <project-id> (GCP project), <port> (ephemeral localhost port), /Users/<user>, <repo> (workspace repos). Only the errors T3 rendered to the user are shown, plus one raw provider event per session as proof.
Add Usage Summary to Sessions#
Thread a9c32eaf, build 0.0.40.
Rendered to the user:
[2026-09-10 08:53:07Z] Agent execution error: model unreachable: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
[2026-09-10 09:03:54Z] Agent connection was lost and could not be re-established: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
Raw provider event (first EOF), masked:
doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
MCQ Appears Before Merge#
Thread 44be7094, build 0.0.40.
Rendered to the user:
[2026-09-10 12:41:33Z] Agent execution error: model unreachable: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
[2026-09-10 12:44:25Z] Agent connection was lost and could not be re-established: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
Raw provider event (first EOF), masked:
doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
Complete Issues and Browser Verification#
Thread bc8e2486, build 0.0.40.
Rendered to the user:
[2026-09-10 12:41:35Z] Agent execution error: model unreachable: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
[2026-09-10 12:44:16Z] Agent connection was lost and could not be re-established: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
Raw provider event (first EOF), masked:
doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
Assess Vitest 5 Test Breakages#
Thread 23e080f0, build 0.0.41-nightly.20260913.
Rendered to the user:
[2026-09-14 01:24:37Z] Agent execution error: model unreachable: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF: doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
[2026-09-14 01:55:05Z] Agent connection was lost and could not be re-established: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
Raw provider event (first EOF), masked:
doRequest: error sending request: Post "http://127.0.0.1:<port>/v1beta1/projects/<project-id>/locations/us/publishers/google/models/gemini-3.8-flash-high:streamGenerateContent?alt=sse": EOF
juliusmarminge added labelsbug
juliusmarminge added labelsaccepted
juliusmarminge added labelsvia-triage
juliusmarminge added labelsupstream
Thanks for the fast triage, and for the correction on the recovery path.
You're right: recovery is
recoverSessionForThread(ProviderService.tsL1227), notProviderInstanceRegistry. That registry is the settings hot-reload path, so my fourth bullet named the wrong file. The rest lines up with what you verified:mapAcpToAdapterErrorforwardserror.messageunchanged,mapAntigravityErroronly remaps sign-in, and the live runtime latches onConnectionTerminatedwith no retry.I'll leave the issue body unedited so this correction stays in the thread rather than rewriting history.
Your three-part fix matches what I'd want as someone who keeps hitting this: classify the transient class, retry
startSessionwith backoff (fresh session if resume hits the binary's failed rebuild), and treat a clean in-runtime close as a disconnect to recover from rather than a one-way latch.I have the full provider event logs for all four sessions if the raw binary-side rebuild sequence would help. I can share them unscrubbed through a private channel; the issue only carries the masked excerpts.
hey @juliusmarminge any update on this and the new issue #11767
currently can't really use antigravity in t3 code until these issues are fixed
juliusmarminge closed this
Sign in to join this conversation.
Triage#
Confirmed as a real Antigravity / ACP reliability bug. Four sessions across
0.0.40and0.0.41-nightlyis enough; the two user-facing strings match what the adapter forwards today.What we verified#
mapAcpToAdapterError(apps/server/src/provider/acp/AcpAdapterSupport.ts) setsdetail: error.messagewith no transient/network branch. Antigravity only remaps sign-in. A droppedstreamGenerateContent(EOF) therefore lands in chat asmodel unreachable: doRequest … EOF.AcpSessionRuntime.ensureConnectedrethrows a latched termination.recordTermination/retireRuntimedo not reconnect.AntigravityAdapterhas no prompt retry/backoff. OnConnectionTerminatedit tears the session down (hasSession→ false).ProviderService.recoverSessionForThread→startSession+ resume cursor — notProviderInstanceRegistry(that path is settings hot-reload). NeitherFailed to rebuild agentnorreceived 1000 (OK); then sent 1000 (OK)exists in this repo. Those come fromagy_acp_server(Go websocket close phrasing). T3 surfaces them unchanged. Code1000is a normal close; the agent’s own rebuild still fails, and we treat that as fatal.T3 vs upstream#
agy_acp_serverdroppingstreamGenerateContentwithEOF, and failing its own agent rebuild on WS1000startSession/session/promptafter a clean closeRetry-with-backoff of
streamGenerateContentis the proxy’s job. T3 should still stop showing transport internals and should recover the session the way a second send often does today.Related#
session/load. Closest prior art. Antigravity already retires onConnectionTerminated; the gap is classify + retry after the binary’s failed rebuild.No duplicate issue found.
Proposed fix (T3)#
EOF/model unreachable/1000 (OK)/Failed to rebuild agentas transient inmapAntigravityError(or sharedmapAcpToAdapterError). Show a short readable message.startSessionwith backoff on that class of error. If resume/session/loadhits the binary’s failed rebuild, start a fresh session instead of failing the turn.Workaround remains: send the prompt again (often starts a fresh agent).
Accepting as
bug+upstream. T3 handling should ship without waiting on the proxy.