@yemi33/minions 0.1.1750 → 0.1.1751

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Changelog
2
2
 
3
- ## 0.1.1750 (2026-05-06)
3
+ ## 0.1.1751 (2026-05-06)
4
+
5
+ ### Features
6
+ - install unhandledRejection / uncaughtException crash handlers (P-h1crash-4e21) (#2122)
4
7
 
5
8
  ### Fixes
6
9
  - lock doc-chat into plain-response mode (no tool calls) (#2127)
package/dashboard.js CHANGED
@@ -7389,6 +7389,33 @@ What would you like to discuss or change? When you're happy, say "approve" and I
7389
7389
  }
7390
7390
  });
7391
7391
 
7392
+ // Crash handlers — install before listen() so a rogue Promise rejection or
7393
+ // thrown error in any request handler is logged via shared.log instead of
7394
+ // silently killing the dashboard with no audit trail.
7395
+ //
7396
+ // Mirrors the pattern in engine/cli.js, but tuned for a long-running HTTP
7397
+ // server: unhandledRejection is logged-and-recovered (transient bugs in
7398
+ // individual requests should not take down the whole process), while
7399
+ // uncaughtException sets process.exitCode = 1 and lets pending writes flush
7400
+ // (per Node docs, the process state is undefined after an uncaught exception,
7401
+ // so the safe move is to log, mark exit-non-zero, and let the runtime tear
7402
+ // down naturally rather than calling process.exit() synchronously).
7403
+ function _installCrashHandlers() {
7404
+ process.on('unhandledRejection', (reason) => {
7405
+ const msg = reason instanceof Error ? reason.stack || reason.message : String(reason);
7406
+ console.error(`[dashboard] Unhandled promise rejection: ${msg}`);
7407
+ try { shared.log('error', `dashboard unhandledRejection: ${msg}`); } catch { /* best effort */ }
7408
+ });
7409
+
7410
+ process.on('uncaughtException', (err) => {
7411
+ const msg = err instanceof Error ? err.stack || err.message : String(err);
7412
+ console.error(`[dashboard] Uncaught exception: ${msg}`);
7413
+ try { shared.log('error', `dashboard uncaughtException: ${msg}`); } catch { /* best effort */ }
7414
+ try { shared.flushLogs(); } catch { /* best effort */ }
7415
+ process.exitCode = 1;
7416
+ });
7417
+ }
7418
+
7392
7419
  // Exported for testing — pure helpers with no hidden side effects.
7393
7420
  // Production entry points use the closures directly; tests import via require('./dashboard').
7394
7421
  module.exports = {
@@ -7418,12 +7445,17 @@ module.exports = {
7418
7445
  _formatCcApiRoutesIndex,
7419
7446
  _formatCcCliCommandsIndex,
7420
7447
  _resetPreambleCache,
7448
+ _installCrashHandlers,
7421
7449
  };
7422
7450
 
7423
7451
  // Start the HTTP server only when run directly (node dashboard.js).
7424
7452
  // When required as a module (e.g. by unit tests), skip the listen/watchdog/signal
7425
7453
  // handlers so tests can import exported helpers without binding to port 7331.
7426
7454
  if (require.main === module) {
7455
+ // Install crash handlers FIRST so any error during bootstrap (HTML assembly,
7456
+ // engine reads, port binding) is captured rather than dying silently.
7457
+ _installCrashHandlers();
7458
+
7427
7459
  server.listen(PORT, '127.0.0.1', () => {
7428
7460
  console.log(`\n Minions Mission Control`);
7429
7461
  console.log(` -----------------------------------`);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "runtime": "copilot",
3
3
  "models": null,
4
- "cachedAt": "2026-05-06T20:21:49.605Z"
4
+ "cachedAt": "2026-05-06T20:22:59.939Z"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yemi33/minions",
3
- "version": "0.1.1750",
3
+ "version": "0.1.1751",
4
4
  "description": "Multi-agent AI dev team that runs from ~/.minions/ — five autonomous agents share a single engine, dashboard, and knowledge base",
5
5
  "bin": {
6
6
  "minions": "bin/minions.js"