instar 1.3.224 → 1.3.225

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+wDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA68PtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0SH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+wDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAq9PtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -15,7 +15,7 @@ import { fileURLToPath } from 'node:url';
15
15
  import pc from 'picocolors';
16
16
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
17
17
  import { loadConfig, ensureStateDir, detectTmuxPath } from '../core/Config.js';
18
- import { isNonFatalUncaught } from '../core/uncaughtExceptionPolicy.js';
18
+ import { isNonFatalUncaught, shouldLogStackForUncaught } from '../core/uncaughtExceptionPolicy.js';
19
19
  import { closeAllSqlite } from '../core/SqliteRegistry.js';
20
20
  import { SessionManager } from '../core/SessionManager.js';
21
21
  import { StateManager } from '../core/StateManager.js';
@@ -9591,7 +9591,14 @@ export async function startServer(options) {
9591
9591
  // work). See isNonFatalUncaught for the allowlist + rationale (HTTP
9592
9592
  // double-response races, Slack Socket Mode reconnect races).
9593
9593
  if (isNonFatalUncaught(err)) {
9594
- console.warn(`[WARN] Non-fatal uncaught exception (suppressed): ${err.message}`);
9594
+ // Attach the stack the first time a given origin is seen so the offending
9595
+ // call site (e.g. a route that double-responds → "Cannot set headers")
9596
+ // is diagnosable; repeats log message-only to avoid flooding the log
9597
+ // (these isolated races recur ~10-20x/hour).
9598
+ const stackSuffix = shouldLogStackForUncaught(err) && err.stack
9599
+ ? `\n first-seen stack (for diagnosis):\n${err.stack}`
9600
+ : '';
9601
+ console.warn(`[WARN] Non-fatal uncaught exception (suppressed): ${err.message}${stackSuffix}`);
9595
9602
  return; // Don't crash — the server is fine
9596
9603
  }
9597
9604
  console.error('[FATAL] Uncaught exception — closing databases before crash:', err.message);