t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Unhandled AcpTransportError / AcpProcessExitedError strands thread in 'running' state without error banner or session recovery

Open HITECHDEM opened this issue 2 weeks ago • 0 comments

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

  1. Start an extended multi-turn ACP session (e.g. Antigravity or another external ACP adapter).
  2. During a long-running turn or high memory load, trigger an abrupt child process termination (or simulate an ACP crash, causing pipe disconnect).
  3. Observe events.<thread_id>.log and the thread UI.

Expected behavior

  1. 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 mark orchestration_v2_projection_runs.status = 'failed' (or 'interrupted').
  2. 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 to session/new followed by session/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 in status = '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/resume against the new process instance without falling back to session/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

  1. Process Exit Supervisor: In the ACP client provider adapter, listen for exit/error events 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.
  2. Session Recovery Cascade: If session/resume fails with an invalid session error (common after process restarts), catch the failure and perform session/new followed by session/load(sessionId).

HITECHDEM avatar Nov 15 '26 22:11 HITECHDEM