v10.2.6

thedotmack/claude-memv10.2.6Feb 18, 2026by thedotmack

AI Summary

This is a bug fix release addressing a critical zombie process accumulation issue in observer CLI subprocesses. The fix implements a dual-layer approach: immediate cleanup through finally blocks in SessionRoutes.ts and worker-service.ts, plus periodic background reaping via reapStaleSessions() to kill orphaned processes with SIGKILL escalation.

Key Highlights

  • Fixed zombie process accumulation in observer CLI subprocesses (#1168, #1175)
  • Added ensureProcessExit() calls to finally blocks in SessionRoutes.ts and worker-service.ts
  • Implemented reapStaleSessions() in SessionManager for periodic background cleanup
  • Added SIGKILL escalation for killing orphan processes
  • Prevents resource leaks on long-running systems

Full Release Notes

## Bug Fixes

### Zombie Process Prevention (#1168, #1175)

Observer Claude CLI subprocesses were accumulating as zombies — processes that never exited after their session ended, causing massive resource leaks on long-running systems.

**Root cause:** When observer sessions ended (via idle timeout, abort, or error), the spawned Claude CLI subprocesses were not being reliably killed. The existing `ensureProcessExit()` in `SDKAgent` only covered the happy path; sessions terminated through `SessionRoutes` or `worker-service` bypassed process cleanup entirely.

**Fix — dual-layer approach:**

1. **Immediate cleanup:** Added `ensureProcessExit()` calls to the `finally` blocks in both `SessionRoutes.ts` and `worker-service.ts`, ensuring every session exit path kills its subprocess
2. **Periodic reaping:** Added `reapStaleSessions()` to `SessionManager` — a background interval that scans `~/.claude-mem/observer-sessions/` for stale PID files, verifies the process is still running, and kills any orphans with SIGKILL escalation

This ensures no observer subprocess survives beyond its session lifetime, even in crash scenarios.