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: overhaul session lifecycle to fix crashes, message loss, and duplicate notifications
Root cause: ClaudeProcess.isReady() returned `alive` (set immediately on spawn),
so sendInput() bypassed readiness checks and sent messages before the process
had initialized. This caused message loss, process crashes, infinite restart
loops, and broken session naming.
Five fixes:
1. ClaudeProcess.isReady() now requires system_init to have been received,
not just process alive — fulfills the CodingProcess interface contract.
2. sendInput() restructured: readiness check applies to ALL paths, not just
the auto-start branch. Messages are always queued via waitForReady() when
the process hasn't initialized yet.
3. Lifetime restart cap (10 total) prevents infinite restart loops. Previously
the 5-min cooldown reset allowed sessions to restart hundreds of times.
4. Duplicate "Session started" eliminated: frontend no longer shows a message
for claude_started; only the system_init (with model info) serves as the
"session ready" notification.
5. Session naming env includes XDG_* dirs for proper Claude CLI config/auth
resolution (was stripped to just PATH+HOME).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments