Repository navigation
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
Steps to reproduce
- Start an Antigravity thread (
gemini-4-argon) in T3 Code using the managedagy_acp_server.par(v1.4.5) runtime. - Trigger a condition where the underlying
localharness_externalsubprocess disconnects or closes its local WebSocket connection toagy_acp_server.par(for example, when a heavy background command is cancelled viamanage_task(kill)during active output streaming). - Send a follow-up prompt in the same thread:
- On the first follow-up prompt,
agy_acp_server.pardetects the closed connection and attemptsself._rebuild_session_agent(session_id). - Inside
_rebuild_session_agent,await session_info.stack.aclose()invokeslocal_connection.disconnect(), which attempts to sendsession_end_requestover the already-closed WebSocket, raisingwebsockets.exceptions.ConnectionClosedOK. agy_acp_server.parfails to rebuild the agent and dropssession_idfrom its in-memory session dictionary, while theagy_acp_server.parprocess itself stays alive.
- On the first follow-up prompt,
- Send any subsequent prompt in the thread.
Expected behavior
When AcpAdapterV2.startTurn receives an unrecoverable session error (AcpRequestError: Internal error / ValueError: Session not found: <session_id>) from a long-lived agy_acp_server.par process, T3 Code should invalidate/recycle that ACP runtime process (or re-issue session/resume against the persisted <session_id>.db conversation file) so the thread can automatically recover on the next turn.
Actual behavior
T3 Code keeps reusing the same alive agy_acp_server.par process whose in-memory session table no longer has <session_id>, causing every subsequent prompt on the thread to permanently fail with AcpRequestError: Internal error until agy_acp_server.par is manually killed.
Impact
Major degradation or frequent failure
Version or commit
0.1.7-nightly.20261103.4119
Environment
Linux x64 (Ubuntu), T3 Code Server 0.1.7-nightly.20261103.4119, managed Antigravity ACP runtime 1.4.5 (923923a0d7dc8073...), gemini-4-argon
Logs or stack traces
# T3 Code boot-service.log
WARN: orchestration-v2.acp-prompt-failed
driver: 'antigravity',
cause: 'AcpRequestError: Internal error\n' +
' at AcpRequestError.fromProtocolError (.../t3:185219:11)\n' +
' at AcpAdapterV2.startTurn (.../t3:202669:55)'
# agy_acp_server.par.INFO / ERROR
W1104 11:12:19.816289 server.py:5734] Agent connection closed for session <session_id>; rebuilding agent and retrying the turn once.
I1104 11:12:19.816335 agent.py:264] Stopping Agent session
E1104 11:12:19.828619 server.py:5866] Failed to rebuild agent for session <session_id>; connection unrecoverable
Traceback (most recent call last):
File ".../acp_server/server.py", line 2174, in _rebuild_session_agent
await session_info.stack.aclose()
...
File ".../connections/local/local_connection.py", line 575, in disconnect
await self._send_session_end_request()
File ".../websockets/asyncio/connection.py", line 957, in send_context
raise self.protocol.close_exc from original_exc
websockets.exceptions.ConnectionClosedOK: received 1000 (OK); then sent 1000 (OK)
The above exception was the direct cause of the following exception:
File ".../acp_server/server.py", line 5739, in prompt
await self._rebuild_session_agent(session_id)
File ".../acp_server/server.py", line 2207, in _rebuild_session_agent
raise RuntimeError(f"Failed to rebuild agent: {e}") from e
RuntimeError: Failed to rebuild agent: received 1000 (OK); then sent 1000 (OK)
E1104 11:13:23.219281 connection.py:237] Unhandled error while handling request method=session/prompt
Traceback (most recent call last):
File ".../acp_server/server.py", line 5612, in prompt
raise ValueError(f"Session not found: {session_id}")
ValueError: Session not found: <session_id>
Workaround
Manually kill the agy_acp_server.par process on the host (pkill -f agy_acp_server.par). On the next prompt, T3 Code spawns a fresh agy_acp_server.par process and resumes the session from the SQLite .db file on disk.
Activity
juliusmarminge commentedon Nov 19, 2026
Fixed by #23654, now on main: After the reported local-harness disconnect and failed rebuild, sending another message now starts a fresh ACP process and resumes the saved conversation instead of repeatedly failing with Internal error.