Refactor worker scripts to improve logging and error handling

- Updated `new-hook.js` and `save-hook.js` to enhance logging functionality, including better error messages and structured logging.
- Improved the handling of worker startup in `summary-hook.js` and `worker-utils.ts`, ensuring proper directory context for PM2.
- Added checks for worker health and streamlined session management across hooks.
This commit is contained in:
Alex Newman
2025-11-17 14:38:47 -05:00
parent 7d44fdb289
commit d55db524f0
4 changed files with 15 additions and 13 deletions
+2
View File
@@ -56,7 +56,9 @@ async function startWorker(): Promise<boolean> {
}
// Start using PM2 with the ecosystem config
// CRITICAL: Must set cwd to pluginRoot so PM2 starts from marketplace directory
execSync(`pm2 start "${ecosystemPath}"`, {
cwd: pluginRoot,
stdio: 'pipe',
encoding: 'utf-8'
});