instar 1.3.568 → 1.3.570
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/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +30 -50
- package/dist/commands/server.js.map +1 -1
- package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
- package/dist/core/MachinePoolRegistry.js +26 -4
- package/dist/core/MachinePoolRegistry.js.map +1 -1
- package/dist/core/PeerPresencePuller.d.ts +39 -0
- package/dist/core/PeerPresencePuller.d.ts.map +1 -1
- package/dist/core/PeerPresencePuller.js +46 -1
- package/dist/core/PeerPresencePuller.js.map +1 -1
- package/dist/core/uncaughtExceptionPolicy.d.ts +29 -0
- package/dist/core/uncaughtExceptionPolicy.d.ts.map +1 -1
- package/dist/core/uncaughtExceptionPolicy.js +62 -0
- package/dist/core/uncaughtExceptionPolicy.js.map +1 -1
- package/dist/messaging/slack/SocketModeClient.d.ts +32 -0
- package/dist/messaging/slack/SocketModeClient.d.ts.map +1 -1
- package/dist/messaging/slack/SocketModeClient.js +79 -31
- package/dist/messaging/slack/SocketModeClient.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.569.md +68 -0
- package/upgrades/1.3.570.md +69 -0
- package/upgrades/side-effects/slack-subsystem-error-containment.md +225 -0
- package/upgrades/side-effects/statesync-peer-advert-propagation-fix.md +125 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAkH7D,OAAO,EAAE,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/server.js
CHANGED
|
@@ -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, detectGeminiPath } from '../core/Config.js';
|
|
18
|
-
import {
|
|
18
|
+
import { handleProcessLevelError } from '../core/uncaughtExceptionPolicy.js';
|
|
19
19
|
import { resolveDevAgentGate, resolveStateSyncStores } from '../core/devAgentGate.js';
|
|
20
20
|
import { parseProfileTrigger, platformMessageIdFrom } from '../core/topicProfileIngress.js';
|
|
21
21
|
import { slugifyChannelName } from '../messaging/slack/sanitize.js';
|
|
@@ -15405,31 +15405,17 @@ export async function startServer(options) {
|
|
|
15405
15405
|
fetchPeerCapacity: async (machineId, url) => {
|
|
15406
15406
|
const res = await meshClient.send({ machineId, url }, { type: 'session-status' }, 0);
|
|
15407
15407
|
if (res.ok && res.result && typeof res.result === 'object') {
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
//
|
|
15411
|
-
//
|
|
15412
|
-
//
|
|
15413
|
-
//
|
|
15414
|
-
//
|
|
15415
|
-
//
|
|
15416
|
-
//
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
return {
|
|
15420
|
-
selfReportedLastSeen: cap.selfReportedLastSeen,
|
|
15421
|
-
loadAvg: cap.loadAvg,
|
|
15422
|
-
journalAdvert,
|
|
15423
|
-
...(cap.commitmentsAdvert ? { commitmentsAdvert: cap.commitmentsAdvert } : {}),
|
|
15424
|
-
// §WS2.1 sibling pass-through (the #930/A2 narrowing lesson): the
|
|
15425
|
-
// peer's preferences advert is served but would be dropped here
|
|
15426
|
-
// without this, so drivePreferencesSync would never fire.
|
|
15427
|
-
...(cap.preferencesAdvert ? { preferencesAdvert: cap.preferencesAdvert } : {}),
|
|
15428
|
-
...(cap.quotaState ? { quotaState: cap.quotaState } : {}),
|
|
15429
|
-
// Guard posture rides the same pass-through (the A2 narrowing
|
|
15430
|
-
// lesson): dropping it here would blind the pool to peers' posture.
|
|
15431
|
-
...(cap.guardPosture ? { guardPosture: cap.guardPosture } : {}),
|
|
15432
|
-
};
|
|
15408
|
+
// The journal advert is the one slice that needs closure context
|
|
15409
|
+
// (the machine-id-keyed unwrap), so it is computed HERE; the rest
|
|
15410
|
+
// of the narrowing — commitmentsAdvert (#930), quotaState (A2/#804),
|
|
15411
|
+
// preferencesAdvert (WS2.1), guardPosture, and seamlessnessFlags
|
|
15412
|
+
// (THIS fix, the 4th instance of the narrowing-return-forgets-a-field
|
|
15413
|
+
// class) — is the SINGLE shared `narrowSessionStatusToPeerCapacity`
|
|
15414
|
+
// pass-through that the peer-presence round-trip test also runs, so
|
|
15415
|
+
// the test proves the REAL mapping and a forgotten field can't recur
|
|
15416
|
+
// silently (the wiring-integrity ratchet asserts over this helper).
|
|
15417
|
+
const journalAdvert = _unwrapPeerJournalAdvert(machineId, res.result.journalAdvert);
|
|
15418
|
+
return presenceMod.narrowSessionStatusToPeerCapacity(res.result, journalAdvert);
|
|
15433
15419
|
}
|
|
15434
15420
|
return null;
|
|
15435
15421
|
},
|
|
@@ -16553,31 +16539,25 @@ export async function startServer(options) {
|
|
|
16553
16539
|
// (e.g., cloudflared crash cascade during sleep/wake), close databases to prevent
|
|
16554
16540
|
// the "mutex lock failed" error on next start. This doesn't prevent the crash,
|
|
16555
16541
|
// but ensures the next boot is clean.
|
|
16542
|
+
// Route BOTH process-level error events through one shared decision
|
|
16543
|
+
// (uncaughtExceptionPolicy.handleProcessLevelError) so they cannot drift to
|
|
16544
|
+
// divergent policies: one narrow allowlist (HTTP double-response races, the
|
|
16545
|
+
// Slack Socket Mode reconnect race, standby read-only writes), one
|
|
16546
|
+
// fail-toward-crash default, one dedup'd log path. Isolated/recoverable
|
|
16547
|
+
// errors log-and-continue; anything unknown closes ALL registered SQLite
|
|
16548
|
+
// handles (so the crash exit doesn't compound into a "mutex lock failed"
|
|
16549
|
+
// SIGABRT) and exits — net #2 respawns a clean process in ~10s.
|
|
16550
|
+
//
|
|
16551
|
+
// The unhandledRejection handler is essential, not optional: the Slack
|
|
16552
|
+
// 'message' listener calls the async _handleRawMessage, so an escaping throw
|
|
16553
|
+
// there surfaces as a REJECTION, not a sync exception (net #1). Cleanup is
|
|
16554
|
+
// injected so the policy module stays pure decision-logic.
|
|
16555
|
+
const onFatalCleanup = () => { closeAllSqlite(); };
|
|
16556
16556
|
process.on('uncaughtException', (err) => {
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
if (isNonFatalUncaught(err)) {
|
|
16562
|
-
// Attach the stack the first time a given origin is seen so the offending
|
|
16563
|
-
// call site (e.g. a route that double-responds → "Cannot set headers")
|
|
16564
|
-
// is diagnosable; repeats log message-only to avoid flooding the log
|
|
16565
|
-
// (these isolated races recur ~10-20x/hour).
|
|
16566
|
-
const stackSuffix = shouldLogStackForUncaught(err) && err.stack
|
|
16567
|
-
? `\n first-seen stack (for diagnosis):\n${err.stack}`
|
|
16568
|
-
: '';
|
|
16569
|
-
console.warn(`[WARN] Non-fatal uncaught exception (suppressed): ${err.message}${stackSuffix}`);
|
|
16570
|
-
return; // Don't crash — the server is fine
|
|
16571
|
-
}
|
|
16572
|
-
console.error('[FATAL] Uncaught exception — closing databases before crash:', err.message);
|
|
16573
|
-
// Close ALL registered SQLite handles (not just topic/semantic memory) so
|
|
16574
|
-
// the crash exit doesn't compound into a "mutex lock failed" SIGABRT on top
|
|
16575
|
-
// of the original error. closeAllSqlite() is best-effort + idempotent.
|
|
16576
|
-
try {
|
|
16577
|
-
closeAllSqlite();
|
|
16578
|
-
}
|
|
16579
|
-
catch { /* best effort */ }
|
|
16580
|
-
process.exit(1);
|
|
16557
|
+
handleProcessLevelError(err, 'uncaughtException', { onFatalCleanup });
|
|
16558
|
+
});
|
|
16559
|
+
process.on('unhandledRejection', (reason) => {
|
|
16560
|
+
handleProcessLevelError(reason, 'unhandledRejection', { onFatalCleanup });
|
|
16581
16561
|
});
|
|
16582
16562
|
// Wire the ForegroundRestartWatcher to the graceful shutdown function.
|
|
16583
16563
|
// This ensures auto-update restarts close all resources (especially SQLite
|