You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix session persistence: explicit drain + resilient recv loop
Two bugs caused sessions to die on agent reinstall despite pty-host
keeping shells alive:
1. Health-check TCP connections triggered auto-drain in _handle_client,
consuming ring buffer data meant for the real agent connection.
Fix: drain is now an explicit {"cmd":"drain"} command — health
checks (ping/pong only) never touch ring buffers.
2. recv_loop finally block put None (EOF) into ALL output queues when
TCP connection dropped, causing ManagedSession to close sessions.
Fix: just set _connected=False. read_blocking() now reconnects
to pty-host (3 retries) instead of returning None.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>