instar 1.3.380 → 1.3.381
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 +28 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +20 -2
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/monitoring/SessionRecovery.d.ts +15 -0
- package/dist/monitoring/SessionRecovery.d.ts.map +1 -1
- package/dist/monitoring/SessionRecovery.js +31 -1
- package/dist/monitoring/SessionRecovery.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/upgrades/1.3.381.md +55 -0
- package/upgrades/context-wall-compact-escalation.eli16.md +42 -0
- package/upgrades/side-effects/context-wall-compact-escalation.md +81 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAaH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAuBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiG7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AA6JtD,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAs4BD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAA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,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,GAC/F,IAAI,CAyUN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAutTtE;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"}
|
package/dist/commands/server.js
CHANGED
|
@@ -53,7 +53,7 @@ import { QuotaTracker } from '../monitoring/QuotaTracker.js';
|
|
|
53
53
|
import { AccountSwitcher } from '../monitoring/AccountSwitcher.js';
|
|
54
54
|
import { QuotaNotifier } from '../monitoring/QuotaNotifier.js';
|
|
55
55
|
import { QuotaManager } from '../monitoring/QuotaManager.js';
|
|
56
|
-
import { classifySessionDeath } from '../monitoring/QuotaExhaustionDetector.js';
|
|
56
|
+
import { classifySessionDeath, detectContextExhaustion } from '../monitoring/QuotaExhaustionDetector.js';
|
|
57
57
|
import { SessionWatchdog } from '../monitoring/SessionWatchdog.js';
|
|
58
58
|
import { formatWatchdogUserMessage } from '../monitoring/watchdog-notifications.js';
|
|
59
59
|
import { StallTriageNurse } from '../monitoring/StallTriageNurse.js';
|
|
@@ -5418,6 +5418,33 @@ export async function startServer(options) {
|
|
|
5418
5418
|
console.warn(`[respawnSessionFresh] No platform handler for topicId=${topicId} — recovery is a no-op`);
|
|
5419
5419
|
}
|
|
5420
5420
|
},
|
|
5421
|
+
// Non-destructive context-wall escalation (rung 1, tried before the
|
|
5422
|
+
// fresh respawn): press `/compact` for a session stuck at "Context
|
|
5423
|
+
// limit reached · /compact or /clear to continue" and verify the wall
|
|
5424
|
+
// clears. Preserves the conversation. Only reached for a genuinely
|
|
5425
|
+
// idle session (the recovery gates on !hasActiveProcesses).
|
|
5426
|
+
attemptCompaction: async (name) => {
|
|
5427
|
+
// Press the button the wall asks for.
|
|
5428
|
+
const injected = sessionManager.injectMessage(name, '/compact');
|
|
5429
|
+
if (!injected)
|
|
5430
|
+
return { cleared: false, reason: 'inject-failed' };
|
|
5431
|
+
// Poll for the wall to clear (compaction takes a few seconds).
|
|
5432
|
+
const deadline = Date.now() + 30_000;
|
|
5433
|
+
while (Date.now() < deadline) {
|
|
5434
|
+
await new Promise((r) => setTimeout(r, 3_000));
|
|
5435
|
+
const out = sessionManager.captureOutput(name, 40) || '';
|
|
5436
|
+
const tail = out.split('\n').map((l) => l.trim()).filter(Boolean).slice(-12).join('\n');
|
|
5437
|
+
// Compaction itself failed (too long to even compact) → give up the rung.
|
|
5438
|
+
if (/error during compaction|compaction failed/i.test(tail)) {
|
|
5439
|
+
return { cleared: false, reason: 'compaction-error' };
|
|
5440
|
+
}
|
|
5441
|
+
// Wall gone from the live state → compaction cleared it.
|
|
5442
|
+
if (!detectContextExhaustion(out).matched) {
|
|
5443
|
+
return { cleared: true };
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
return { cleared: false, reason: 'timeout' };
|
|
5447
|
+
},
|
|
5421
5448
|
});
|
|
5422
5449
|
// Track context exhaustion kills to prevent beforeSessionKill from re-saving
|
|
5423
5450
|
// resume UUIDs (which would cause an infinite death loop)
|