v2.14.0
Session-replacement fix + lifecycle observability + token ACL hardening
Fixes the reported instability where, while running several Claude Code windows, "the daemon resets and sessions get replaced by new empty windows." Root-caused via a multi-expert review (see plans/RCA-daemon-session-replacement-2026-05-29.md): the daemon process never actually dies (uptime is monotonic). The renderer's reconnect/reconcile path could not distinguish a transient failure from a permanent one and destructively cleared live ptyIds, making Terminal self-create empty sessions while the daemon still held the originals.
Fixed — live sessions replaced on reconnect (RCA A1/A2)
pty.reconnectnow tags failurestransient(pipe-not-writable / RPC threw during handler swap) vs permanent (session dead).useTerminalretries transient failures with short backoff instead of immediately clearing the surface — a live session no longer gets discarded on a momentary blip.AppLayoutreconcile preserves allptyIds when the daemon returns an empty session list (almost always "not ready yet", not "all dead"). The late-reconnect (daemon:connected) path is now abort/timeout/catch guarded and never falls through toclearAllPtyState.RECONCILE_TIMEOUT_MSis now derived fromDAEMON_RPC_TIMEOUT_MSinshared/timeouts.ts(15s > 10s), removing the asymmetry that let a slow-but-successfulpty.listtrip the destructive startup fallback.
Added — daemon/main lifecycle observability (RCA A8)
- Structured
[lifecycle]logging on daemonattachSession/detachSession, maindaemon:connectedemit,DaemonClient.connecterror codes (EPERM etc.),pty.listlive-session count, and the renderer's destructiveptyId-clear decisions (mirrored into the main log). Reconnect/session-replacement events are now diagnosable post-hoc instead of invisible.
Security — token file ACL re-hardening (RCA A12)
secureWriteTokenFileonly locked permissions when a token was freshly written; a token loaded from disk kept whatever (possibly broad, inherited) ACL it had. NewreHardenTokenFileAcl()re-applies a restrictive ACL (Windowsicacls) /chmod 0600(POSIX) on the existingdaemon-auth-tokenand~/.wmux-auth-tokenat load time. Best-effort: never crashes a live daemon.
Fixed — session config merge + prefix mode
- Merge session config against defaults on load and harden prefix mode handling.
- Skip keybinding back-fill on key collision.