t3code
t3code copied to clipboard
[Bug]: Unhandled AcpTransportError / AcpProcessExitedError strands thread in 'running' state without error banner or session recovery
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Start an extended multi-turn ACP session (e.g. Antigravity or another external ACP adapter).
- During a long-running turn or high memory load, trigger an abrupt child process termination (or simulate an ACP crash, causing pipe disconnect).
- Observe
events.<thread_id>.logand the thread UI.
Expected behavior
- When the ACP child process exits unexpectedly, T3 Code server should detect process exit (
childProcess.on('exit')), log the failure, display an error banner in the UI, and markorchestration_v2_projection_runs.status = 'failed'(or'interrupted'). - Subsequent turns should attempt a graceful reconnection or recovery cascade: try
session/resume, and if resume fails (since the child process is fresh), automatically fall back tosession/newfollowed bysession/load(sessionId).
Actual behavior
The provider event log logs AcpProcessExitedError or AcpTransportError:
NTIVE: {"method":"session/prompt","status":"failed","errorTag":"AcpTransportError","reasonCount":1}
NTIVE: {"method":"session/prompt","status":"failed","errorTag":"AcpProcessExitedError","reasonCount":1}
However:
- The projection database (
orchestration_v2_projection_runs) remains instatus = 'running'indefinitely. - The UI continues to show an active spinner with no error banner.
- Because the run is stuck in
running, T3 Code never prompts the user or restarts the ACP session, leaving the thread deadlocked. - Even upon manual app restart, if T3 Code attempts
session/resumeagainst the new process instance without falling back tosession/new+session/load, the session fails to restore.
Impact
Blocks work completely
Version or commit
T3 Code 0.1.9 / core 0.169.0
Environment
Windows 11 x64, Desktop app, Provider: Antigravity ACP (agy_acp_server)
Workaround & Suggested Fix
- Process Exit Supervisor: In the ACP client provider adapter, listen for
exit/errorevents on the ACP child process. When fired unexpectedly while a run is active, immediately emit a failure event to the projection store to release the thread. - Session Recovery Cascade: If
session/resumefails with an invalid session error (common after process restarts), catch the failure and performsession/newfollowed bysession/load(sessionId).