instar 1.3.162 → 1.3.163

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;AAqSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqwDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAgwPtE;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;AAsSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqwDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0vPtE;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,6 +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
19
  import { SessionManager } from '../core/SessionManager.js';
19
20
  import { StateManager } from '../core/StateManager.js';
20
21
  import { StuckInputSentinel } from '../core/StuckInputSentinel.js';
@@ -9357,17 +9358,11 @@ export async function startServer(options) {
9357
9358
  // the "mutex lock failed" error on next start. This doesn't prevent the crash,
9358
9359
  // but ensures the next boot is clean.
9359
9360
  process.on('uncaughtException', (err) => {
9360
- // Non-fatal HTTP errors — log and continue, don't crash the server.
9361
- // "Cannot set headers" is a double-response race condition (common during
9362
- // tunnel reconnect storms). The affected request is already handled; the
9363
- // server can keep serving new requests.
9364
- const nonFatalPatterns = [
9365
- 'Cannot set headers after they are sent',
9366
- 'write after end',
9367
- 'ERR_HTTP_HEADERS_SENT',
9368
- 'ERR_STREAM_WRITE_AFTER_END',
9369
- ];
9370
- if (nonFatalPatterns.some(p => err.message?.includes(p))) {
9361
+ // Isolated, recoverable uncaught exceptions — log and continue, don't
9362
+ // crash the server (which would close its databases + drop in-flight
9363
+ // work). See isNonFatalUncaught for the allowlist + rationale (HTTP
9364
+ // double-response races, Slack Socket Mode reconnect races).
9365
+ if (isNonFatalUncaught(err)) {
9371
9366
  console.warn(`[WARN] Non-fatal uncaught exception (suppressed): ${err.message}`);
9372
9367
  return; // Don't crash — the server is fine
9373
9368
  }