Skip to content

Commit 5d4e71d

Browse files
thedotmackclaude
andcommitted
fix: run PM2 cleanup on all platforms for quality migration
Previously skipped Windows PM2 cleanup based on assumption that PM2 wasn't used on Windows. However, this left potential orphaned processes. Changes: - Remove platform check (process.platform !== 'win32') - Run PM2 cleanup on Mac/Linux/Windows consistently - Create .pm2-migrated marker on all platforms - Update documentation to reflect cross-platform behavior Rationale: - Quality migration should clean up ALL orphaned processes - Error handling (try/catch) already makes this safe - Even if PM2 had Windows issues, cleanup won't hurt - Consistent behavior across platforms is better UX Impact: - Windows users will get PM2 cleanup on first hook trigger - Marker file now created on Windows (prevents repeated attempts) - No breaking changes (errors caught and ignored) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent f923c0c commit 5d4e71d

File tree

8 files changed

+1564
-12
lines changed

8 files changed

+1564
-12
lines changed

docs/PM2-TO-BUN-MIGRATION.md

Lines changed: 1552 additions & 0 deletions
Large diffs are not rendered by default.

plugin/scripts/cleanup-hook.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/scripts/context-hook.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/scripts/new-hook.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/scripts/save-hook.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/scripts/summary-hook.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin/scripts/user-message-hook.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shared/worker-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ async function startWorker(): Promise<boolean> {
7373
// Clean up legacy PM2 (one-time migration)
7474
const pm2MigratedMarker = path.join(SettingsDefaultsManager.get('CLAUDE_MEM_DATA_DIR'), '.pm2-migrated');
7575

76-
if (process.platform !== 'win32' && !existsSync(pm2MigratedMarker)) {
76+
if (!existsSync(pm2MigratedMarker)) {
7777
try {
7878
spawnSync('pm2', ['delete', 'claude-mem-worker'], { stdio: 'ignore' });
7979
// Mark migration as complete

0 commit comments

Comments
 (0)