Fix WebSocket crash + heartbeat default 10min + docs refresh

- Wrap Baileys connection.update listeners in try-catch to prevent
  unhandled exceptions from crashing the relay process
- Add WebSocket-level error handlers in session.ts
- Add global unhandledRejection/uncaughtException handlers in index.ts
- Make listener.onClose error-safe with .catch() in auto-reply.ts
- Change default heartbeat from 30min to 10min
- Rewrite claude-config.md with personality, better explain personal
  assistant features, add recommended MCPs section
This commit is contained in:
Peter Steinberger
2025-11-27 18:21:14 +01:00
parent 549ad272fc
commit 85f53a4174
7 changed files with 297 additions and 87 deletions

View File

@@ -117,5 +117,23 @@ const isMain =
process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1];
if (isMain) {
// Global error handlers to prevent silent crashes from unhandled rejections/exceptions.
// These log the error and exit gracefully instead of crashing without trace.
process.on("unhandledRejection", (reason, promise) => {
console.error(
"[warelay] Unhandled promise rejection:",
reason instanceof Error ? reason.stack ?? reason.message : reason,
);
process.exit(1);
});
process.on("uncaughtException", (error) => {
console.error(
"[warelay] Uncaught exception:",
error.stack ?? error.message,
);
process.exit(1);
});
program.parseAsync(process.argv);
}