@askexenow/exe-os 0.9.338 → 0.9.340

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  pushToPostgres
4
- } from "../chunk-RDTZTLVQ.js";
4
+ } from "../chunk-7WPOJDTA.js";
5
5
  import "../chunk-B75BOKEI.js";
6
6
  import "../chunk-QLFRCA6I.js";
7
7
  import "../chunk-TLYAEISW.js";
package/dist/bin/cli.js CHANGED
@@ -195,7 +195,7 @@ if (args.includes("--global")) {
195
195
  process.exit(1);
196
196
  }
197
197
  } else if (args[0] === "key") {
198
- const { main: runKey } = await import("../exe-key-RWGMIHK7.js");
198
+ const { main: runKey } = await import("../exe-key-M6TYHNUW.js");
199
199
  await runKey(args.slice(1));
200
200
  } else if (args[0] === "grant") {
201
201
  const { main: runGrant } = await import("./exe-grant.js");
@@ -405,7 +405,7 @@ ID: ${result.id}`);
405
405
  process.exit(1);
406
406
  }
407
407
  } else if (args[0] === "setup" || args[0] === "-setup" || args[0] === "--setup") {
408
- const { runSetupWizard } = await import("../setup-wizard-CJZMM43G.js");
408
+ const { runSetupWizard } = await import("../setup-wizard-TOFEJPLF.js");
409
409
  await runSetupWizard({
410
410
  skipModel: args.includes("--skip-model"),
411
411
  nonInteractive: args.includes("--non-interactive") || args.includes("-y") || args.includes("--yes"),
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  computeMcpSurfaceHash
4
- } from "../chunk-B2GLEEGY.js";
4
+ } from "../chunk-TALWBVZE.js";
5
5
  import "../chunk-WCGNCH3Q.js";
6
- import "../chunk-ISD7ZD45.js";
6
+ import "../chunk-G7WO77Z2.js";
7
7
  import "../chunk-XJI7Z6LZ.js";
8
8
  import "../chunk-557C2IGL.js";
9
9
  import "../chunk-QZLIZAS7.js";
10
10
  import "../chunk-AOO77BDE.js";
11
11
  import "../chunk-6M36JFFD.js";
12
- import "../chunk-UNVHIH7N.js";
12
+ import "../chunk-DRCRZIIJ.js";
13
13
  import "../chunk-CRCB5S7I.js";
14
14
  import "../chunk-W7DHFGCB.js";
15
15
  import "../chunk-PVYR4FCQ.js";
@@ -55,7 +55,7 @@ import "../chunk-2XZ6X3PJ.js";
55
55
  import "../chunk-UXBD22CD.js";
56
56
  import "../chunk-I3XKO3KQ.js";
57
57
  import "../chunk-A47MXY2I.js";
58
- import "../chunk-RDTZTLVQ.js";
58
+ import "../chunk-7WPOJDTA.js";
59
59
  import "../chunk-B75BOKEI.js";
60
60
  import "../chunk-QLFRCA6I.js";
61
61
  import "../chunk-X2Z5GT3V.js";
@@ -76,7 +76,7 @@ import "../chunk-542EWGY3.js";
76
76
  import "../chunk-I7Z6KTGF.js";
77
77
  import "../chunk-UFAXZ2PY.js";
78
78
  import "../chunk-N5I7RL3I.js";
79
- import "../chunk-QBTWXDFK.js";
79
+ import "../chunk-ZREGOV2Q.js";
80
80
  import "../chunk-AB4PAQYK.js";
81
81
  import "../chunk-H37HHX3E.js";
82
82
  import "../chunk-CHCA3ZM2.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "../chunk-6KFICEAT.js";
7
7
  import {
8
8
  assertSecureEndpoint
9
- } from "../chunk-RDTZTLVQ.js";
9
+ } from "../chunk-7WPOJDTA.js";
10
10
  import "../chunk-B75BOKEI.js";
11
11
  import "../chunk-QLFRCA6I.js";
12
12
  import "../chunk-TLYAEISW.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-UFAXZ2PY.js";
5
5
  import {
6
6
  lightweightSearch
7
- } from "../chunk-QBTWXDFK.js";
7
+ } from "../chunk-ZREGOV2Q.js";
8
8
  import "../chunk-AB4PAQYK.js";
9
9
  import "../chunk-H37HHX3E.js";
10
10
  import "../chunk-CHCA3ZM2.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  hybridSearch
4
- } from "../chunk-QBTWXDFK.js";
4
+ } from "../chunk-ZREGOV2Q.js";
5
5
  import "../chunk-AB4PAQYK.js";
6
6
  import {
7
7
  initStore
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  assertSecureEndpoint
3
- } from "../chunk-RDTZTLVQ.js";
3
+ } from "../chunk-7WPOJDTA.js";
4
4
  import "../chunk-B75BOKEI.js";
5
5
  import "../chunk-QLFRCA6I.js";
6
6
  import "../chunk-TLYAEISW.js";
@@ -18,18 +18,18 @@ import {
18
18
  } from "../chunk-KADUJ7PE.js";
19
19
  import {
20
20
  computeMcpSurfaceHash
21
- } from "../chunk-B2GLEEGY.js";
21
+ } from "../chunk-TALWBVZE.js";
22
22
  import {
23
23
  generateSessionWrappers
24
24
  } from "../chunk-CVTWQZOR.js";
25
25
  import "../chunk-WCGNCH3Q.js";
26
- import "../chunk-ISD7ZD45.js";
26
+ import "../chunk-G7WO77Z2.js";
27
27
  import "../chunk-XJI7Z6LZ.js";
28
28
  import "../chunk-557C2IGL.js";
29
29
  import "../chunk-QZLIZAS7.js";
30
30
  import "../chunk-AOO77BDE.js";
31
31
  import "../chunk-6M36JFFD.js";
32
- import "../chunk-UNVHIH7N.js";
32
+ import "../chunk-DRCRZIIJ.js";
33
33
  import "../chunk-CRCB5S7I.js";
34
34
  import "../chunk-W7DHFGCB.js";
35
35
  import "../chunk-PVYR4FCQ.js";
@@ -75,7 +75,7 @@ import "../chunk-2XZ6X3PJ.js";
75
75
  import "../chunk-UXBD22CD.js";
76
76
  import "../chunk-I3XKO3KQ.js";
77
77
  import "../chunk-A47MXY2I.js";
78
- import "../chunk-RDTZTLVQ.js";
78
+ import "../chunk-7WPOJDTA.js";
79
79
  import "../chunk-B75BOKEI.js";
80
80
  import "../chunk-QLFRCA6I.js";
81
81
  import "../chunk-X2Z5GT3V.js";
@@ -96,7 +96,7 @@ import "../chunk-542EWGY3.js";
96
96
  import "../chunk-I7Z6KTGF.js";
97
97
  import "../chunk-UFAXZ2PY.js";
98
98
  import "../chunk-N5I7RL3I.js";
99
- import "../chunk-QBTWXDFK.js";
99
+ import "../chunk-ZREGOV2Q.js";
100
100
  import "../chunk-AB4PAQYK.js";
101
101
  import {
102
102
  resolveEmbeddingsEnabled
package/dist/bin/setup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSetupWizard
4
- } from "../chunk-Z7OZP3ET.js";
4
+ } from "../chunk-F55JF43M.js";
5
5
  import "../chunk-TPHCZDE3.js";
6
6
  import "../chunk-Z42MXYWW.js";
7
7
  import "../chunk-7Y5UDEVM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  lightweightSearch
3
- } from "./chunk-QBTWXDFK.js";
3
+ } from "./chunk-ZREGOV2Q.js";
4
4
  import "./chunk-AB4PAQYK.js";
5
5
  import "./chunk-H37HHX3E.js";
6
6
  import "./chunk-CHCA3ZM2.js";
@@ -590,7 +590,13 @@ async function cloudPushPendingMemories(client, config, options) {
590
590
  LIMIT ?`,
591
591
  args: [scanVersion, scanVersion, scanRowid, PUSH_BATCH_SIZE + 1]
592
592
  });
593
- if (recordsResult.rows.length === 0) break;
593
+ if (recordsResult.rows.length === 0) {
594
+ process.stderr.write(
595
+ `[cloud-sync] memory push scan ended: no rows after version=${scanVersion}, rowid=${scanRowid}, cursor=${safeCursor}
596
+ `
597
+ );
598
+ break;
599
+ }
594
600
  const pageRows = recordsResult.rows;
595
601
  const hasExtra = pageRows.length > PUSH_BATCH_SIZE;
596
602
  const rowsToPush = hasExtra ? pageRows.slice(0, PUSH_BATCH_SIZE) : pageRows;
@@ -786,12 +792,22 @@ async function cloudSync(config, options) {
786
792
  try {
787
793
  const incomingIds = pullResult.records.map((r) => sqlSafe(r.id));
788
794
  if (incomingIds.length > 0) {
789
- const ph = incomingIds.map(() => "?").join(",");
790
- const existing = await client.execute({
791
- sql: `SELECT id, version, timestamp FROM memories WHERE id IN (${ph})`,
792
- args: incomingIds
793
- });
794
- const localMap = new Map(existing.rows.map((r) => [String(r.id), r]));
795
+ const localMap = /* @__PURE__ */ new Map();
796
+ const chunkSize = 500;
797
+ for (let i = 0; i < incomingIds.length; i += chunkSize) {
798
+ const chunk = incomingIds.slice(i, i + chunkSize);
799
+ const ph = chunk.map(() => "?").join(",");
800
+ const existing = await client.execute({
801
+ sql: `SELECT id, version, timestamp FROM memories WHERE id IN (${ph})`,
802
+ args: chunk
803
+ });
804
+ for (const row of existing.rows) {
805
+ localMap.set(String(row.id), row);
806
+ }
807
+ if (i + chunkSize < incomingIds.length) {
808
+ await new Promise((resolve) => setImmediate(resolve));
809
+ }
810
+ }
795
811
  for (const rec of pullResult.records) {
796
812
  const local = localMap.get(String(rec.id));
797
813
  if (local && Number(local.version) > 0 && Number(local.version) !== Number(rec.version ?? 0)) {
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  isRerankerAvailable,
23
23
  rerankWithScores
24
- } from "./chunk-UNVHIH7N.js";
24
+ } from "./chunk-DRCRZIIJ.js";
25
25
  import {
26
26
  getEntityByName,
27
27
  getEntityNeighbors,
@@ -175,7 +175,7 @@ import {
175
175
  cloudSync,
176
176
  getCloudReuploadRequired,
177
177
  markCloudReuploadRequired
178
- } from "./chunk-RDTZTLVQ.js";
178
+ } from "./chunk-7WPOJDTA.js";
179
179
  import {
180
180
  createARecord
181
181
  } from "./chunk-X2Z5GT3V.js";
@@ -224,7 +224,7 @@ import {
224
224
  import {
225
225
  hybridSearch,
226
226
  recentRecords
227
- } from "./chunk-QBTWXDFK.js";
227
+ } from "./chunk-ZREGOV2Q.js";
228
228
  import {
229
229
  buildFtsMatch,
230
230
  tokenizeForFts
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-WCGNCH3Q.js";
4
4
  import {
5
5
  registerAllTools
6
- } from "./chunk-ISD7ZD45.js";
6
+ } from "./chunk-G7WO77Z2.js";
7
7
 
8
8
  // src/mcp/mcp-surface-hash.ts
9
9
  function computeMcpSurfaceHash() {
@@ -359,7 +359,7 @@ async function hybridSearch(queryText, agentId, options) {
359
359
  let rerankerAvailable = false;
360
360
  if (process.env.EXE_IS_DAEMON === "1") {
361
361
  try {
362
- const { isRerankerAvailable } = await import("./reranker-6UQSZVV2.js");
362
+ const { isRerankerAvailable } = await import("./reranker-QATGTAPC.js");
363
363
  rerankerAvailable = isRerankerAvailable();
364
364
  } catch {
365
365
  }
@@ -561,7 +561,7 @@ async function hybridSearch(queryText, agentId, options) {
561
561
  try {
562
562
  let rerankedRecords;
563
563
  if (graphContextMap.size > 0) {
564
- const { rerankWithContext } = await import("./reranker-6UQSZVV2.js");
564
+ const { rerankWithContext } = await import("./reranker-QATGTAPC.js");
565
565
  const candidates = merged.map((m) => ({
566
566
  text: m.raw_text,
567
567
  context: graphContextMap.get(m.id)
@@ -569,7 +569,7 @@ async function hybridSearch(queryText, agentId, options) {
569
569
  const scored = await rerankWithContext(effectiveQuery, candidates, rerankReturnLimit);
570
570
  rerankedRecords = scored.map((s) => merged[s.index]);
571
571
  } else {
572
- const { rerank } = await import("./reranker-6UQSZVV2.js");
572
+ const { rerank } = await import("./reranker-QATGTAPC.js");
573
573
  rerankedRecords = await rerank(effectiveQuery, merged, rerankReturnLimit);
574
574
  }
575
575
  if (rerankedRecords.length > 0) {
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  computeMcpSurfaceHash
4
- } from "./chunk-B2GLEEGY.js";
4
+ } from "./chunk-TALWBVZE.js";
5
5
  import "./chunk-WCGNCH3Q.js";
6
- import "./chunk-ISD7ZD45.js";
6
+ import "./chunk-G7WO77Z2.js";
7
7
  import "./chunk-XJI7Z6LZ.js";
8
8
  import "./chunk-557C2IGL.js";
9
9
  import "./chunk-QZLIZAS7.js";
10
10
  import "./chunk-AOO77BDE.js";
11
11
  import "./chunk-6M36JFFD.js";
12
- import "./chunk-UNVHIH7N.js";
12
+ import "./chunk-DRCRZIIJ.js";
13
13
  import "./chunk-CRCB5S7I.js";
14
14
  import "./chunk-W7DHFGCB.js";
15
15
  import "./chunk-PVYR4FCQ.js";
@@ -55,7 +55,7 @@ import "./chunk-2XZ6X3PJ.js";
55
55
  import "./chunk-UXBD22CD.js";
56
56
  import "./chunk-I3XKO3KQ.js";
57
57
  import "./chunk-A47MXY2I.js";
58
- import "./chunk-RDTZTLVQ.js";
58
+ import "./chunk-7WPOJDTA.js";
59
59
  import "./chunk-B75BOKEI.js";
60
60
  import "./chunk-QLFRCA6I.js";
61
61
  import "./chunk-X2Z5GT3V.js";
@@ -76,7 +76,7 @@ import "./chunk-542EWGY3.js";
76
76
  import "./chunk-I7Z6KTGF.js";
77
77
  import "./chunk-UFAXZ2PY.js";
78
78
  import "./chunk-N5I7RL3I.js";
79
- import "./chunk-QBTWXDFK.js";
79
+ import "./chunk-ZREGOV2Q.js";
80
80
  import "./chunk-AB4PAQYK.js";
81
81
  import "./chunk-H37HHX3E.js";
82
82
  import "./chunk-CHCA3ZM2.js";
@@ -5,7 +5,7 @@ import "../chunk-SH45SJQW.js";
5
5
  import {
6
6
  hybridSearch,
7
7
  lightweightSearch
8
- } from "../chunk-QBTWXDFK.js";
8
+ } from "../chunk-ZREGOV2Q.js";
9
9
  import "../chunk-AB4PAQYK.js";
10
10
  import {
11
11
  resolveHookSearchEnabled
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "version": 1,
3
- "generatedAt": "2026-07-05T05:12:14.610Z",
3
+ "generatedAt": "2026-07-05T06:30:18.177Z",
4
4
  "hashes": {
5
5
  "bug-report-worker.js": "6b730f6ef154b1ef7ed1325c4434c132efac63f0c792ea03e941a1596ae0ffe7",
6
6
  "codex-stop-task-finalizer.js": "1bef88c86140c00efb6dc2fd0934587dc8d36c0586e03a53311dad623d52bb0e",
7
7
  "commit-complete.js": "5742fe6906207c0ae26806e1300db135a747c44ac811a3be828744d8bad88c48",
8
- "error-recall.js": "62c5ddb6613739363d7c4e4b57308a0f33dd06799c7a1a161a0f6535b519c7d6",
8
+ "error-recall.js": "861fff982b7ee8d57bcb003345532c3435fbf3104ee0d8a1cb619fd876a22c00",
9
9
  "exe-heartbeat-hook.js": "886c05d173844e44a2f5aded74c01e83fa8fdc6b48485cfcbb62f18ca869f2ea",
10
10
  "ingest-worker.js": "fb42110931002e4078cd2b85ce604ae9205e5c1511601e87ab38bfef6e6ed284",
11
11
  "ingest.js": "18dd359240fe1b851c9acffb8a2d21dc8b1af7e47a28a9b4568fe1ecd4909b89",
@@ -15,9 +15,9 @@
15
15
  "post-tool-combined.js": "fc73f0cd2eaa61ac3fae295d97b9e50a4c58726774bd2313db8216d60fdf7272",
16
16
  "pre-compact.js": "58e28bb928af497aa6078ffb051abc0fa9dae7ba5306897637781dbce54ac4be",
17
17
  "pre-tool-use.js": "8268c74b98c21e4a76ebd03d2e44d65b8d4c0593fe38bfc922ac772397b0b412",
18
- "prompt-submit.js": "758a016ff09f04c24e485713c8e3e1d06c5c4da3e8b52b405d6b6ec86b02348a",
18
+ "prompt-submit.js": "bb7f4fd4330b54f27e47df063e0363e46e87bb49b648ff778c79cc99b16e055a",
19
19
  "session-end.js": "8ead090ff8fa96e0a139895126aee87806f5410bcac17bc139f4e652ceb5c013",
20
- "session-start.js": "09579a3ea991163ec9e9286a361328a173a14bac89239719679e6bd0a53d3f78",
20
+ "session-start.js": "280d2f1689b800253aaa9716bd451eea59a0ff1733af81c486576e36b87e0889",
21
21
  "stop.js": "0bd3f1a0396fe44c3173cf4d55452f04b79b85ceee6d770a5576a0959bd81919",
22
22
  "subagent-stop.js": "eb98b3b59b2d813432b30ca3ff23d4e15ec00f886932c4002cade099f9f9f526",
23
23
  "summary-worker.js": "f8e95cb13e9828e73eb958d4e74cd8378cc440cb0a051c7b720026e97e2f05c7"
@@ -6,7 +6,7 @@ import "../chunk-SH45SJQW.js";
6
6
  import {
7
7
  hybridSearch,
8
8
  lightweightSearch
9
- } from "../chunk-QBTWXDFK.js";
9
+ } from "../chunk-ZREGOV2Q.js";
10
10
  import "../chunk-AB4PAQYK.js";
11
11
  import {
12
12
  resolveHookSearchEnabled
@@ -207,7 +207,7 @@ You are **${ag.agentId}**. The daemon was degraded at boot \u2014 memory context
207
207
  query = `last actions on ${projectName}`;
208
208
  header = "## Resuming Session\nHere's where you left off:";
209
209
  try {
210
- const { buildCatchupBrief } = await import("../catchup-brief-S35QLMG3.js");
210
+ const { buildCatchupBrief } = await import("../catchup-brief-DRRQCMKA.js");
211
211
  const brief = await buildCatchupBrief(
212
212
  agentId,
213
213
  projectName,
@@ -51,7 +51,7 @@ import {
51
51
  pushToPostgres,
52
52
  recordRosterDeletion,
53
53
  shouldUseCrdtMergeForCloudSync
54
- } from "../chunk-RDTZTLVQ.js";
54
+ } from "../chunk-7WPOJDTA.js";
55
55
  import "../chunk-B75BOKEI.js";
56
56
  import "../chunk-QLFRCA6I.js";
57
57
  import "../chunk-TLYAEISW.js";
@@ -467,47 +467,57 @@ function isHostCpuStarved(load1m, cpuCount, ratio) {
467
467
  }
468
468
  function decideDaemonSelfHeal(s) {
469
469
  const alive = s.processAlive ?? true;
470
- const resetSelfInflicted = { selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
471
470
  if (!alive) {
472
- return { restart: true, reason: "process_dead", consecutiveSevereAfter: 0, ...resetSelfInflicted };
471
+ return { restart: true, reason: "process_dead", consecutiveSevereAfter: 0, selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
473
472
  }
474
473
  if (typeof s.rssBytes === "number" && Number.isFinite(s.rssBytes) && typeof s.rssCapBytes === "number" && Number.isFinite(s.rssCapBytes) && s.rssCapBytes > 0 && s.rssBytes > s.rssCapBytes) {
475
- return { restart: true, reason: "rss_over_cap", consecutiveSevereAfter: 0, ...resetSelfInflicted };
476
- }
474
+ return { restart: true, reason: "rss_over_cap", consecutiveSevereAfter: 0, selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
475
+ }
476
+ const now = typeof s.nowMs === "number" && Number.isFinite(s.nowMs) ? s.nowMs : 0;
477
+ const windowMs = typeof s.selfInflictedRollingWindowMs === "number" && s.selfInflictedRollingWindowMs > 0 ? s.selfInflictedRollingWindowMs : 3e5;
478
+ const prunedWindow = (s.selfInflictedWindow ?? []).filter((e) => now - e.ts < windowMs);
479
+ const sumOf = (w) => w.reduce((a, e) => a + e.lagMs, 0);
480
+ const carry = {
481
+ selfInflictedWindowAfter: prunedWindow,
482
+ selfInflictedStreakAfter: prunedWindow.length,
483
+ selfInflictedSuppressedMsAfter: sumOf(prunedWindow)
484
+ };
485
+ const cleared = { selfInflictedWindowAfter: [], selfInflictedStreakAfter: 0, selfInflictedSuppressedMsAfter: 0 };
477
486
  if (isHostCpuStarved(s.load1m, s.cpuCount, s.starvationRatio)) {
478
- return { restart: false, reason: "starved_backoff", consecutiveSevereAfter: 0, ...resetSelfInflicted };
487
+ return { restart: false, reason: "starved_backoff", consecutiveSevereAfter: 0, ...carry };
479
488
  }
480
489
  if (s.catchUpActive) {
481
- return { restart: false, reason: "catchup_backoff", consecutiveSevereAfter: 0, ...resetSelfInflicted };
490
+ return { restart: false, reason: "catchup_backoff", consecutiveSevereAfter: 0, ...carry };
482
491
  }
483
492
  const selfCpuRatio = Number.isFinite(s.selfCpuBusyRatio) ? s.selfCpuBusyRatio : 0.5;
484
493
  if (s.lagMs > s.severeThresholdMs && typeof s.selfCpuBusyFraction === "number" && Number.isFinite(s.selfCpuBusyFraction) && s.selfCpuBusyFraction >= selfCpuRatio) {
485
- const streakLimit = typeof s.selfInflictedLimit === "number" && s.selfInflictedLimit > 0 ? s.selfInflictedLimit : 5;
494
+ const countLimit = typeof s.selfInflictedLimit === "number" && s.selfInflictedLimit > 0 ? s.selfInflictedLimit : 5;
486
495
  const suppressCapMs = typeof s.selfInflictedSuppressCapMs === "number" && s.selfInflictedSuppressCapMs > 0 ? s.selfInflictedSuppressCapMs : 15e4;
487
- const streakNext = (s.selfInflictedStreak ?? 0) + 1;
488
- const suppressedNext = (s.selfInflictedSuppressedMs ?? 0) + s.lagMs;
489
- if (streakNext >= streakLimit || suppressedNext > suppressCapMs) {
490
- return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...resetSelfInflicted };
496
+ const windowAfter = [...prunedWindow, { ts: now, lagMs: s.lagMs }];
497
+ const sumInWindow = sumOf(windowAfter);
498
+ if (sumInWindow > suppressCapMs || windowAfter.length >= countLimit) {
499
+ return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...cleared };
491
500
  }
492
501
  return {
493
502
  restart: false,
494
503
  reason: "self_inflicted_backoff",
495
504
  consecutiveSevereAfter: 0,
496
- selfInflictedStreakAfter: streakNext,
497
- selfInflictedSuppressedMsAfter: suppressedNext
505
+ selfInflictedWindowAfter: windowAfter,
506
+ selfInflictedStreakAfter: windowAfter.length,
507
+ selfInflictedSuppressedMsAfter: sumInWindow
498
508
  };
499
509
  }
500
510
  if (s.lagMs > s.singleBlockMs) {
501
- return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...resetSelfInflicted };
511
+ return { restart: true, reason: "single_block", consecutiveSevereAfter: 0, ...cleared };
502
512
  }
503
513
  if (s.lagMs > s.severeThresholdMs) {
504
514
  const next = s.consecutiveSevere + 1;
505
515
  if (next >= s.consecutiveLimit) {
506
- return { restart: true, reason: "consecutive_blocks", consecutiveSevereAfter: next, ...resetSelfInflicted };
516
+ return { restart: true, reason: "consecutive_blocks", consecutiveSevereAfter: next, ...cleared };
507
517
  }
508
- return { restart: false, reason: "counting", consecutiveSevereAfter: next, ...resetSelfInflicted };
518
+ return { restart: false, reason: "counting", consecutiveSevereAfter: next, ...carry };
509
519
  }
510
- return { restart: false, reason: "not_critical", consecutiveSevereAfter: 0, ...resetSelfInflicted };
520
+ return { restart: false, reason: "not_critical", consecutiveSevereAfter: 0, ...carry };
511
521
  }
512
522
  function decideOrchestrationTickSkip(s) {
513
523
  if (isHostCpuStarved(s.load1m, s.cpuCount, s.starvationRatio)) {
@@ -6664,14 +6674,14 @@ function startEventLoopLagDetector() {
6664
6674
  const SELF_CPU_BUSY_RATIO = parseFloat(process.env.EXE_SELF_CPU_BUSY_RATIO ?? "") || 0.5;
6665
6675
  const SELF_INFLICTED_LIMIT = parseInt(process.env.EXE_SELF_INFLICTED_LIMIT ?? "") || 5;
6666
6676
  const SELF_INFLICTED_SUPPRESS_CAP_MS = parseFloat(process.env.EXE_SELF_INFLICTED_SUPPRESS_CAP_MS ?? "") || 15e4;
6677
+ const SELF_INFLICTED_ROLLING_WINDOW_MS = parseFloat(process.env.EXE_SELF_INFLICTED_ROLLING_WINDOW_MS ?? "") || 3e5;
6667
6678
  const LAG_WARN_MS = 3e3;
6668
6679
  const LAG_CRITICAL_MS = 1e4;
6669
6680
  const SELF_HEAL_SINGLE_MS = parseFloat(process.env.EXE_SELF_HEAL_SINGLE_MS ?? "") || 12e4;
6670
6681
  const SELF_HEAL_CONSECUTIVE = parseInt(process.env.EXE_SELF_HEAL_CONSECUTIVE ?? "") || 3;
6671
6682
  const SELF_HEAL_THRESHOLD_MS = parseFloat(process.env.EXE_SELF_HEAL_THRESHOLD_MS ?? "") || 3e4;
6672
6683
  let consecutiveSevereBlocks = 0;
6673
- let selfInflictedStreak = 0;
6674
- let selfInflictedSuppressedMs = 0;
6684
+ let selfInflictedWindow = [];
6675
6685
  touchEventLoopHeartbeat();
6676
6686
  const lagTimer = setInterval(() => {
6677
6687
  touchEventLoopHeartbeat();
@@ -6686,8 +6696,6 @@ function startEventLoopLagDetector() {
6686
6696
  setEventLoopLagMs(clockJump ? 0 : Math.max(0, lag));
6687
6697
  if (clockJump) {
6688
6698
  consecutiveSevereBlocks = 0;
6689
- selfInflictedStreak = 0;
6690
- selfInflictedSuppressedMs = 0;
6691
6699
  try {
6692
6700
  unlinkSync2(path3.join(os2.homedir(), ".exe-os", "session-cache", "event-loop-blocked.marker"));
6693
6701
  } catch {
@@ -6739,15 +6747,15 @@ function startEventLoopLagDetector() {
6739
6747
  selfCpuBusyFraction,
6740
6748
  selfCpuBusyRatio: SELF_CPU_BUSY_RATIO,
6741
6749
  catchUpActive,
6742
- // FIX 1: thread the self-inflicted ceiling accumulators.
6743
- selfInflictedStreak,
6744
- selfInflictedSuppressedMs,
6750
+ // Fast-follow #341: thread the ROLLING-WINDOW self-inflicted ceiling.
6751
+ nowMs: Date.now(),
6752
+ selfInflictedWindow,
6753
+ selfInflictedRollingWindowMs: SELF_INFLICTED_ROLLING_WINDOW_MS,
6745
6754
  selfInflictedLimit: SELF_INFLICTED_LIMIT,
6746
6755
  selfInflictedSuppressCapMs: SELF_INFLICTED_SUPPRESS_CAP_MS
6747
6756
  });
6748
6757
  consecutiveSevereBlocks = decision.consecutiveSevereAfter;
6749
- selfInflictedStreak = decision.selfInflictedStreakAfter;
6750
- selfInflictedSuppressedMs = decision.selfInflictedSuppressedMsAfter;
6758
+ selfInflictedWindow = decision.selfInflictedWindowAfter;
6751
6759
  if (decision.reason === "starved_backoff") {
6752
6760
  process.stderr.write(
6753
6761
  `[exed] SELF-HEAL SUPPRESSED: load=${load1m.toFixed(2)} cpus=${cpuCount} \u2014 lag is CPU starvation, not internal hang. Skipping restart.
@@ -6775,15 +6783,17 @@ function startEventLoopLagDetector() {
6775
6783
  return;
6776
6784
  }
6777
6785
  if (decision.reason === "self_inflicted_backoff") {
6786
+ const winSumMs = decision.selfInflictedSuppressedMsAfter;
6787
+ const winCount = decision.selfInflictedStreakAfter;
6778
6788
  process.stderr.write(
6779
- `[exed] SELF-HEAL SUPPRESSED: self-inflicted block \u2014 daemon busy ${(selfCpuBusyFraction * 100).toFixed(0)}% of a ${(wallElapsedMs / 1e3).toFixed(1)}s window on its own work (load=${load1m.toFixed(2)}/${cpuCount}); letting it drain [streak ${selfInflictedStreak}/${SELF_INFLICTED_LIMIT}, suppressed ${(selfInflictedSuppressedMs / 1e3).toFixed(0)}s/${SELF_INFLICTED_SUPPRESS_CAP_MS / 1e3}s].
6789
+ `[exed] SELF-HEAL SUPPRESSED: self-inflicted block \u2014 daemon busy ${(selfCpuBusyFraction * 100).toFixed(0)}% of a ${(wallElapsedMs / 1e3).toFixed(1)}s window on its own work (load=${load1m.toFixed(2)}/${cpuCount}); letting it drain [rolling ${(winSumMs / 1e3).toFixed(0)}s/${SELF_INFLICTED_SUPPRESS_CAP_MS / 1e3}s over ${SELF_INFLICTED_ROLLING_WINDOW_MS / 1e3}s, ${winCount}/${SELF_INFLICTED_LIMIT} blocks].
6780
6790
  `
6781
6791
  );
6782
6792
  logDaemonHealth({
6783
6793
  event: "self_heal_suppressed_starvation",
6784
6794
  pid: process.pid,
6785
- message: `self-inflicted block \u2014 busy ${(selfCpuBusyFraction * 100).toFixed(0)}% of window \u2014 restart skipped (streak ${selfInflictedStreak}/${SELF_INFLICTED_LIMIT})`,
6786
- data: { lagMs: lag, load1m, cpuCount, reason: "self_inflicted_backoff", selfCpuBusyFraction, selfInflictedStreak, selfInflictedSuppressedMs }
6795
+ message: `self-inflicted block \u2014 busy ${(selfCpuBusyFraction * 100).toFixed(0)}% of window \u2014 restart skipped (rolling ${(winSumMs / 1e3).toFixed(0)}s/${SELF_INFLICTED_SUPPRESS_CAP_MS / 1e3}s)`,
6796
+ data: { lagMs: lag, load1m, cpuCount, reason: "self_inflicted_backoff", selfCpuBusyFraction, rollingSumMs: winSumMs, rollingCount: winCount }
6787
6797
  });
6788
6798
  return;
6789
6799
  }
@@ -6819,12 +6829,8 @@ function startEventLoopLagDetector() {
6819
6829
  process.stderr.write(`[exed] Event loop lag: ${(lag / 1e3).toFixed(1)}s (warn threshold: ${LAG_WARN_MS / 1e3}s)
6820
6830
  `);
6821
6831
  consecutiveSevereBlocks = 0;
6822
- selfInflictedStreak = 0;
6823
- selfInflictedSuppressedMs = 0;
6824
6832
  } else {
6825
6833
  consecutiveSevereBlocks = 0;
6826
- selfInflictedStreak = 0;
6827
- selfInflictedSuppressedMs = 0;
6828
6834
  writeDaemonReady({ pid: process.pid, port: _boundMcpPort });
6829
6835
  }
6830
6836
  }, 2e3);
@@ -5,7 +5,7 @@ import {
5
5
  recentRecords,
6
6
  rrfMerge,
7
7
  rrfMergeMulti
8
- } from "../chunk-QBTWXDFK.js";
8
+ } from "../chunk-ZREGOV2Q.js";
9
9
  import "../chunk-AB4PAQYK.js";
10
10
  import "../chunk-H37HHX3E.js";
11
11
  import "../chunk-CHCA3ZM2.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  registerAllTools
3
- } from "../chunk-ISD7ZD45.js";
3
+ } from "../chunk-G7WO77Z2.js";
4
4
  import "../chunk-XJI7Z6LZ.js";
5
5
  import "../chunk-557C2IGL.js";
6
6
  import "../chunk-QZLIZAS7.js";
7
7
  import "../chunk-AOO77BDE.js";
8
8
  import "../chunk-6M36JFFD.js";
9
- import "../chunk-UNVHIH7N.js";
9
+ import "../chunk-DRCRZIIJ.js";
10
10
  import "../chunk-CRCB5S7I.js";
11
11
  import "../chunk-W7DHFGCB.js";
12
12
  import "../chunk-PVYR4FCQ.js";
@@ -52,7 +52,7 @@ import "../chunk-2XZ6X3PJ.js";
52
52
  import "../chunk-UXBD22CD.js";
53
53
  import "../chunk-I3XKO3KQ.js";
54
54
  import "../chunk-A47MXY2I.js";
55
- import "../chunk-RDTZTLVQ.js";
55
+ import "../chunk-7WPOJDTA.js";
56
56
  import "../chunk-B75BOKEI.js";
57
57
  import "../chunk-QLFRCA6I.js";
58
58
  import "../chunk-X2Z5GT3V.js";
@@ -73,7 +73,7 @@ import "../chunk-542EWGY3.js";
73
73
  import "../chunk-I7Z6KTGF.js";
74
74
  import "../chunk-UFAXZ2PY.js";
75
75
  import "../chunk-N5I7RL3I.js";
76
- import "../chunk-QBTWXDFK.js";
76
+ import "../chunk-ZREGOV2Q.js";
77
77
  import "../chunk-AB4PAQYK.js";
78
78
  import "../chunk-H37HHX3E.js";
79
79
  import "../chunk-CHCA3ZM2.js";
@@ -10,13 +10,13 @@ import {
10
10
  } from "../chunk-WCGNCH3Q.js";
11
11
  import {
12
12
  registerAllTools
13
- } from "../chunk-ISD7ZD45.js";
13
+ } from "../chunk-G7WO77Z2.js";
14
14
  import "../chunk-XJI7Z6LZ.js";
15
15
  import "../chunk-557C2IGL.js";
16
16
  import "../chunk-QZLIZAS7.js";
17
17
  import "../chunk-AOO77BDE.js";
18
18
  import "../chunk-6M36JFFD.js";
19
- import "../chunk-UNVHIH7N.js";
19
+ import "../chunk-DRCRZIIJ.js";
20
20
  import "../chunk-CRCB5S7I.js";
21
21
  import "../chunk-W7DHFGCB.js";
22
22
  import "../chunk-PVYR4FCQ.js";
@@ -67,7 +67,7 @@ import "../chunk-2XZ6X3PJ.js";
67
67
  import "../chunk-UXBD22CD.js";
68
68
  import "../chunk-I3XKO3KQ.js";
69
69
  import "../chunk-A47MXY2I.js";
70
- import "../chunk-RDTZTLVQ.js";
70
+ import "../chunk-7WPOJDTA.js";
71
71
  import "../chunk-B75BOKEI.js";
72
72
  import "../chunk-QLFRCA6I.js";
73
73
  import "../chunk-X2Z5GT3V.js";
@@ -90,7 +90,7 @@ import "../chunk-542EWGY3.js";
90
90
  import "../chunk-I7Z6KTGF.js";
91
91
  import "../chunk-UFAXZ2PY.js";
92
92
  import "../chunk-N5I7RL3I.js";
93
- import "../chunk-QBTWXDFK.js";
93
+ import "../chunk-ZREGOV2Q.js";
94
94
  import "../chunk-AB4PAQYK.js";
95
95
  import {
96
96
  disposeStore,
@@ -5,7 +5,7 @@ import {
5
5
  rerank,
6
6
  rerankWithContext,
7
7
  rerankWithScores
8
- } from "./chunk-UNVHIH7N.js";
8
+ } from "./chunk-DRCRZIIJ.js";
9
9
  import "./chunk-7Y5UDEVM.js";
10
10
  import "./chunk-SHIICYJW.js";
11
11
  import "./chunk-MLKGABMK.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runSetupWizard,
3
3
  validateModel
4
- } from "./chunk-Z7OZP3ET.js";
4
+ } from "./chunk-F55JF43M.js";
5
5
  import "./chunk-TPHCZDE3.js";
6
6
  import "./chunk-Z42MXYWW.js";
7
7
  import "./chunk-7Y5UDEVM.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askexenow/exe-os",
3
- "version": "0.9.338",
3
+ "version": "0.9.340",
4
4
  "description": "AI employee operating system — persistent memory, task management, and multi-agent coordination for Claude Code.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -1,6 +1,30 @@
1
1
  {
2
- "current": "0.9.338",
2
+ "current": "0.9.340",
3
3
  "notes": {
4
+ "0.9.340": {
5
+ "version": "0.9.340",
6
+ "date": "2026-07-05",
7
+ "features": [],
8
+ "fixes": [
9
+ "restore cloud memory backlog sync (#337)"
10
+ ],
11
+ "security": [],
12
+ "other": [
13
+ "bump v0.9.340 (#346)"
14
+ ],
15
+ "migration_notes": []
16
+ },
17
+ "0.9.339": {
18
+ "version": "0.9.339",
19
+ "date": "2026-07-05",
20
+ "features": [],
21
+ "fixes": [
22
+ "rolling-window self-inflicted ceiling — close periodic-block evasion (fast-follow #341) (#344)"
23
+ ],
24
+ "security": [],
25
+ "other": [],
26
+ "migration_notes": []
27
+ },
4
28
  "0.9.338": {
5
29
  "version": "0.9.338",
6
30
  "date": "2026-07-05",
@@ -9,9 +33,7 @@
9
33
  "de-block event-loop timers + starvation-aware self-heal (ddbfc3f6) (#341)"
10
34
  ],
11
35
  "security": [],
12
- "other": [
13
- "bump v0.9.338 (#343)"
14
- ],
36
+ "other": [],
15
37
  "migration_notes": []
16
38
  },
17
39
  "0.9.337": {
@@ -85,61 +107,6 @@
85
107
  "add merge_group trigger to enable GitHub Merge Queue (batches PRs, ends per-push runner storms; runs on self-hosted build-my, zero hosted minutes)"
86
108
  ],
87
109
  "migration_notes": []
88
- },
89
- "0.9.329": {
90
- "version": "0.9.329",
91
- "date": "2026-07-04",
92
- "features": [],
93
- "fixes": [
94
- "make db read worker tolerate parent disconnect"
95
- ],
96
- "security": [],
97
- "other": [
98
- "release: bump exe-os to 0.9.329",
99
- "stabilize ci daemon hook coverage"
100
- ],
101
- "migration_notes": []
102
- },
103
- "0.9.328": {
104
- "version": "0.9.328",
105
- "date": "2026-07-04",
106
- "features": [
107
- "admin-only set_customer_plan MCP tool + POST /admin/customer/plan (feature 46497a13)",
108
- "add license plan-refresh procedure so all agents know how to pick up a plan change"
109
- ],
110
- "fixes": [
111
- "extract prose graph entities",
112
- "verify prompt task notifications",
113
- "canonicalize claude context model ids",
114
- "harden gateway security defaults",
115
- "route cognition through api router",
116
- "Fix hook latency and stop safety guards",
117
- "verify worktree branch reuse",
118
- "recover deleted worktree daemon sessions",
119
- "sync customer feature status via admin route",
120
- "sanitize styled agent model ids",
121
- "persist otel telemetry to clickhouse",
122
- "sync wiki MCP compose pin with stack manifest",
123
- "fix hook timeout and daemon session env",
124
- "fix task lifecycle cleanup edge cases",
125
- "fix cognition warnings and CI runner cargo isolation",
126
- "fix codex spawn and lane affinity checks",
127
- "bound skill sweep and harden db lock release",
128
- "fix daemon client reconnect persistence",
129
- "isolate MCP request path from event-loop lag + reap orphaned coordinator sessions (bug 6c46d301)"
130
- ],
131
- "security": [],
132
- "other": [
133
- "release: bump exe-os to 0.9.328",
134
- "remove destructive postgres volume guidance",
135
- "sync stack parity wiki mcp pin",
136
- "release: bump exe-os to 0.9.326",
137
- "release: bump exe-os to 0.9.325",
138
- "release: bump npm for v0.9.29 stack manifest",
139
- "release(stack): v0.9.29 — today's merged daemon/gateway/crm/wiki fixes, signed",
140
- "add merge_group trigger to enable GitHub Merge Queue (batches PRs, ends per-push runner storms; runs on self-hosted build-my, zero hosted minutes)"
141
- ],
142
- "migration_notes": []
143
110
  }
144
111
  }
145
112
  }
File without changes
File without changes