fix: port ensureMemoryDaemon to TypeScript session-start hook#2
Merged
fix: port ensureMemoryDaemon to TypeScript session-start hook#2
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ported from parcadei/Continuous-Claude-v3#157 by @udhaya10
Summary
ensure_memory_daemon()from the dead Python hook to the registered TypeScript hookarchival_memorytable will actually populate with extracted learningsRoot Cause
ensure_memory_daemon()existed insession_start_continuity.py(Python) butsettings.jsonregisterssession-start-continuity.mjs(TypeScript) which had zero memory/daemon logic.Test plan
memory-daemon.pidcreated