Skip to content

fix: port ensureMemoryDaemon to TypeScript session-start hook#2

Merged
Lisztos merged 2 commits intomainfrom
fix/memory-daemon-autostart
Mar 25, 2026
Merged

fix: port ensureMemoryDaemon to TypeScript session-start hook#2
Lisztos merged 2 commits intomainfrom
fix/memory-daemon-autostart

Conversation

@Lisztos
Copy link
Copy Markdown
Owner

@Lisztos Lisztos commented Mar 24, 2026

Ported from parcadei/Continuous-Claude-v3#157 by @udhaya10


Summary

  • Port ensure_memory_daemon() from the dead Python hook to the registered TypeScript hook
  • Memory daemon now auto-starts on every session start (was never starting)
  • archival_memory table will actually populate with extracted learnings

Root Cause

ensure_memory_daemon() existed in session_start_continuity.py (Python) but settings.json registers session-start-continuity.mjs (TypeScript) which had zero memory/daemon logic.

Test plan

  • Start fresh session → verify memory-daemon.pid created
  • Start second session → daemon NOT restarted (already running)
  • Kill daemon, start session → daemon auto-restarts

udhaya10 and others added 2 commits February 24, 2026 20:51
The memory daemon was never auto-started because ensure_memory_daemon()
only existed in the Python hook (never registered) while the registered
MJS hook had zero memory/daemon logic.

Port the function to session-start-continuity.ts with improvements:
- Logs to ~/.claude/memory-daemon.log instead of /dev/null
- Warns on stderr if daemon script not found
- Uses spawn() with detached + unref for proper daemonization

Fixes parcadei#156

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
process.kill(pid, 0) throws EPERM when the process is alive but owned
by a different context. Treat EPERM as daemon running to avoid
spawning duplicates.
@Lisztos Lisztos merged commit 07c604c into main Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants