[Bug]: Antigravity turn ends on a dropped ACP stream: raw proxy error shown, no reconnect after a clean WebSocket close (1000)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/server/src/provider/acp/AcpAdapterSupport.ts and inspect mapAcpToAdapterError, then trace session recovery through AcpSessionRuntime.ts, AntigravityAdapter.ts, and ProviderInstanceRegistry.ts. Reproduce or inspect the dropped stream and clean WebSocket-close paths. Done means transient failures produce readable errors, dropped streams can retry with backoff, and a normal close can recover without requiring the user to restart the turn.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100