@askexenow/exe-os 0.9.159 → 0.9.160

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.
Files changed (135) hide show
  1. package/dist/{backfill-metadata-2JEFIROE.js → backfill-metadata-JIIVYDUA.js} +1 -1
  2. package/dist/bin/agentic-ontology-backfill.js +1 -1
  3. package/dist/bin/agentic-reflection-backfill.js +1 -1
  4. package/dist/bin/agentic-semantic-label.js +1 -1
  5. package/dist/bin/backfill-conversations.js +1 -1
  6. package/dist/bin/backfill-responses.js +1 -1
  7. package/dist/bin/backfill-vectors.js +2 -2
  8. package/dist/bin/bulk-sync-postgres.js +2 -2
  9. package/dist/bin/cleanup-stale-review-tasks.js +2 -2
  10. package/dist/bin/cli.js +5 -5
  11. package/dist/bin/exe-assign.js +1 -1
  12. package/dist/bin/exe-boot.js +3 -3
  13. package/dist/bin/exe-cloud.js +1 -1
  14. package/dist/bin/exe-dispatch.js +2 -2
  15. package/dist/bin/exe-doctor.js +1 -1
  16. package/dist/bin/exe-export-behaviors.js +2 -2
  17. package/dist/bin/exe-forget.js +3 -3
  18. package/dist/bin/exe-gateway.js +4 -4
  19. package/dist/bin/exe-heartbeat.js +2 -2
  20. package/dist/bin/exe-kill.js +3 -3
  21. package/dist/bin/exe-launch-agent.js +17 -2
  22. package/dist/bin/exe-pending-messages.js +3 -3
  23. package/dist/bin/exe-pending-notifications.js +2 -2
  24. package/dist/bin/exe-pending-reviews.js +2 -2
  25. package/dist/bin/exe-review.js +3 -3
  26. package/dist/bin/exe-search.js +2 -2
  27. package/dist/bin/exe-session-cleanup.js +5 -5
  28. package/dist/bin/exe-settings.js +1 -1
  29. package/dist/bin/exe-start-codex.js +1 -1
  30. package/dist/bin/exe-start-opencode.js +1 -1
  31. package/dist/bin/exe-status.js +3 -3
  32. package/dist/bin/exe-team.js +1 -1
  33. package/dist/bin/git-sweep.js +2 -2
  34. package/dist/bin/graph-backfill.js +1 -1
  35. package/dist/bin/graph-export.js +2 -2
  36. package/dist/bin/intercom-check.js +3 -3
  37. package/dist/bin/scan-tasks.js +2 -2
  38. package/dist/bin/setup.js +1 -1
  39. package/dist/bin/shard-migrate.js +1 -1
  40. package/dist/{capacity-monitor-MSQGHO27.js → capacity-monitor-WOX3YB66.js} +2 -2
  41. package/dist/{catchup-brief-TSMPWHXT.js → catchup-brief-273H5SII.js} +3 -3
  42. package/dist/{chunk-ACRIYPBC.js → chunk-44FRIHFS.js} +3 -3
  43. package/dist/{chunk-2PI3WQ47.js → chunk-4WH3U6YR.js} +2 -2
  44. package/dist/{chunk-BOAP6EJD.js → chunk-52JA6FT3.js} +1 -1
  45. package/dist/{chunk-RSNIF5FB.js → chunk-75ICUSA3.js} +2 -2
  46. package/dist/{chunk-IKDK7NXN.js → chunk-7N2VDN76.js} +51 -10
  47. package/dist/{chunk-PQFTZDR4.js → chunk-AMX4CR2E.js} +1 -1
  48. package/dist/{chunk-FVQ7BELN.js → chunk-AV3BIPWB.js} +1 -1
  49. package/dist/{chunk-SPG7BS6Y.js → chunk-EJOTMMWW.js} +24 -24
  50. package/dist/{chunk-ARTF7DMV.js → chunk-EYPMCM34.js} +2 -2
  51. package/dist/{chunk-37KXWPTL.js → chunk-FNPVO7GB.js} +1 -1
  52. package/dist/{chunk-RJTIEXYH.js → chunk-GIUZGQ2G.js} +2 -2
  53. package/dist/{chunk-7WXL6XVN.js → chunk-HB3HIKKO.js} +3 -3
  54. package/dist/{chunk-5HVWTVZI.js → chunk-IDJ6ZZ6A.js} +2 -2
  55. package/dist/{chunk-SNTCGJAE.js → chunk-K7ZSU4DV.js} +33 -12
  56. package/dist/{chunk-CQFBWHQT.js → chunk-OAXVEPFZ.js} +1 -1
  57. package/dist/{chunk-OYQHH5SX.js → chunk-P5VV55Y6.js} +106 -55
  58. package/dist/{chunk-EEH5SNIW.js → chunk-RVVG5QOG.js} +1 -1
  59. package/dist/{chunk-3J4AJLED.js → chunk-RZJMEZD2.js} +4 -4
  60. package/dist/{chunk-IJXYCSUR.js → chunk-SBDMN3UH.js} +1 -1
  61. package/dist/{chunk-F6LDN5XB.js → chunk-SKE3GZIB.js} +3 -3
  62. package/dist/{chunk-NABY2RI6.js → chunk-U2NOATX5.js} +1 -1
  63. package/dist/{chunk-SI7P22A5.js → chunk-V746MLQJ.js} +1 -1
  64. package/dist/{chunk-VUBQUWJH.js → chunk-VJ6OHRKJ.js} +1 -1
  65. package/dist/{chunk-VLQKYNIO.js → chunk-XTMKDKYH.js} +1 -1
  66. package/dist/{chunk-SCZJGD2G.js → chunk-Y3VSSBI7.js} +1 -1
  67. package/dist/{conversation-wiki-populator-HVROKOEU.js → conversation-wiki-populator-YMNIDI4F.js} +1 -1
  68. package/dist/{crm-webhook-5RIOZV43.js → crm-webhook-K5ZMZ7NE.js} +2 -2
  69. package/dist/{cto-delegation-gate-WPYOYKCC.js → cto-delegation-gate-FQH7V5NO.js} +1 -1
  70. package/dist/{daemon-orchestration-WZ3ITBAJ.js → daemon-orchestration-6LAYDGDI.js} +7 -3
  71. package/dist/{exe-export-CJFBFOBQ.js → exe-export-MI37HELB.js} +1 -1
  72. package/dist/{exe-import-HWP2FOVB.js → exe-import-3H5I674C.js} +1 -1
  73. package/dist/{fast-db-init-43JVJVVH.js → fast-db-init-OLKGFPSS.js} +1 -1
  74. package/dist/gateway/index.js +5 -5
  75. package/dist/{git-task-sweep-GXSLBPEQ.js → git-task-sweep-ZEPT3OL5.js} +2 -2
  76. package/dist/hooks/bug-report-worker.js +3 -3
  77. package/dist/hooks/codex-stop-task-finalizer.js +3 -3
  78. package/dist/hooks/commit-complete.js +32 -7
  79. package/dist/hooks/error-recall.js +2 -2
  80. package/dist/hooks/ingest.js +2 -2
  81. package/dist/hooks/instructions-loaded.js +1 -1
  82. package/dist/hooks/notification.js +1 -1
  83. package/dist/hooks/post-compact.js +2 -2
  84. package/dist/hooks/post-tool-combined.js +2 -2
  85. package/dist/hooks/pre-compact.js +3 -3
  86. package/dist/hooks/pre-tool-use.js +6 -6
  87. package/dist/hooks/prompt-submit.js +8 -8
  88. package/dist/hooks/session-end.js +6 -6
  89. package/dist/hooks/session-start.js +4 -4
  90. package/dist/hooks/stop.js +5 -5
  91. package/dist/hooks/subagent-stop.js +2 -2
  92. package/dist/hooks/summary-worker.js +5 -5
  93. package/dist/index.js +8 -8
  94. package/dist/lib/cloud-sync.js +1 -1
  95. package/dist/lib/consolidation.js +2 -2
  96. package/dist/lib/exe-daemon.js +13 -13
  97. package/dist/lib/hybrid-search.js +2 -2
  98. package/dist/lib/messaging.js +2 -2
  99. package/dist/lib/schedules.js +2 -2
  100. package/dist/lib/store.js +1 -1
  101. package/dist/lib/tasks.js +2 -2
  102. package/dist/lib/tmux-routing.js +1 -1
  103. package/dist/mcp/register-tools.js +21 -21
  104. package/dist/mcp/server.js +22 -22
  105. package/dist/mcp/tools/create-task.js +3 -3
  106. package/dist/mcp/tools/list-tasks.js +3 -3
  107. package/dist/mcp/tools/send-message.js +3 -3
  108. package/dist/mcp/tools/update-task.js +3 -3
  109. package/dist/{notifications-WNSNHFH6.js → notifications-D4SRWBIW.js} +1 -1
  110. package/dist/{orchestrator-KGIIN4BA.js → orchestrator-IH7HSL3I.js} +2 -2
  111. package/dist/{projection-worker-IEDLDFKB.js → projection-worker-EABM5JO4.js} +140 -1
  112. package/dist/{review-polling-MQ3AXSTB.js → review-polling-E2F4T27N.js} +2 -2
  113. package/dist/runtime/index.js +3 -3
  114. package/dist/{session-events-DUWUFNSD.js → session-events-5YG56NLB.js} +2 -2
  115. package/dist/{session-scope-TU7M4FAA.js → session-scope-CWBSZTZM.js} +1 -1
  116. package/dist/{setup-wizard-B5F7C765.js → setup-wizard-YCU4S2NQ.js} +1 -1
  117. package/dist/{task-enforcement-6AAUCRFV.js → task-enforcement-CSO56VZB.js} +1 -1
  118. package/dist/{task-scope-3UOAF4QQ.js → task-scope-54WKRGBQ.js} +1 -1
  119. package/dist/{tasks-crud-NQLF7DVV.js → tasks-crud-KJ5P3AWZ.js} +1 -1
  120. package/dist/{tasks-review-K52CYJ3R.js → tasks-review-4J5ODCPR.js} +1 -1
  121. package/dist/tui/App.js +12 -12
  122. package/dist/{tui-data-E3XA3HLZ.js → tui-data-ZNUWNYHT.js} +1 -1
  123. package/dist/{wiki-client-NZR7RW4I.js → wiki-client-S6JKY7GG.js} +22 -1
  124. package/dist/{worker-gate-J5RRT27H.js → worker-gate-GB6MR4AC.js} +1 -1
  125. package/dist/{workflow-engine-4U4H4V6K.js → workflow-engine-U3LC77BS.js} +2 -2
  126. package/package.json +1 -1
  127. package/release-notes.json +81 -81
  128. /package/dist/{chunk-JC7GZZVA.js → chunk-5MOAOYG6.js} +0 -0
  129. /package/dist/{chunk-CSTCUDVM.js → chunk-BHYRHHKG.js} +0 -0
  130. /package/dist/{chunk-PWNIKVDA.js → chunk-KQN4OAI3.js} +0 -0
  131. /package/dist/{chunk-NGVIZCGB.js → chunk-OI4LP6IC.js} +0 -0
  132. /package/dist/{chunk-33KYUOK2.js → chunk-QUQ4RKO4.js} +0 -0
  133. /package/dist/{core-memory-TFPUGGWO.js → core-memory-LC4CCGI2.js} +0 -0
  134. /package/dist/{exe-key-S3Q3Q2LE.js → exe-key-ZO7APVL6.js} +0 -0
  135. /package/dist/{skill-refinement-RRSHVVV7.js → skill-refinement-QYSXB6YR.js} +0 -0
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  lightweightSearch
3
- } from "./chunk-BOAP6EJD.js";
4
- import "./chunk-CSTCUDVM.js";
3
+ } from "./chunk-52JA6FT3.js";
4
+ import "./chunk-BHYRHHKG.js";
5
5
  import "./chunk-5UPBAAPS.js";
6
6
  import {
7
7
  sessionScopeFilter,
8
8
  strictSessionScopeFilter
9
- } from "./chunk-SNTCGJAE.js";
9
+ } from "./chunk-K7ZSU4DV.js";
10
10
  import "./chunk-LOQCOHEW.js";
11
11
  import "./chunk-TXSJ2L5O.js";
12
12
  import "./chunk-64WZEXXA.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-MLXJ5EZG.js";
4
4
  import {
5
5
  createTask
6
- } from "./chunk-F6LDN5XB.js";
6
+ } from "./chunk-SKE3GZIB.js";
7
7
  import {
8
8
  getActiveAgent
9
9
  } from "./chunk-XFA26MHB.js";
@@ -11,7 +11,7 @@ import {
11
11
  ensureEmployee,
12
12
  logTaskDispatch,
13
13
  resolveExeSession
14
- } from "./chunk-SNTCGJAE.js";
14
+ } from "./chunk-K7ZSU4DV.js";
15
15
  import {
16
16
  getLicenseSync
17
17
  } from "./chunk-GP436PAK.js";
@@ -185,7 +185,7 @@ function registerCreateTask(server) {
185
185
  let projectConflictOpts = {};
186
186
  try {
187
187
  const { getClient } = await import("./lib/database.js");
188
- const { sessionScopeFilter } = await import("./task-scope-3UOAF4QQ.js");
188
+ const { sessionScopeFilter } = await import("./task-scope-54WKRGBQ.js");
189
189
  const client = getClient();
190
190
  const scope = sessionScopeFilter();
191
191
  const existing = await client.execute({
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  fastDbInit
3
- } from "./chunk-NGVIZCGB.js";
3
+ } from "./chunk-OI4LP6IC.js";
4
4
  import {
5
5
  sessionScopeFilter
6
- } from "./chunk-SNTCGJAE.js";
6
+ } from "./chunk-K7ZSU4DV.js";
7
7
  import {
8
8
  formatStatusAll,
9
9
  formatStatusDeep,
@@ -3,7 +3,7 @@ import {
3
3
  buildRawVisibilityFilter,
4
4
  buildWikiScopeFilter,
5
5
  searchMemories
6
- } from "./chunk-CSTCUDVM.js";
6
+ } from "./chunk-BHYRHHKG.js";
7
7
  import {
8
8
  getClient
9
9
  } from "./chunk-JTS3IDOY.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  createCRMWebhookHandler,
15
15
  parseTwentyWebhook
16
- } from "./chunk-PQFTZDR4.js";
16
+ } from "./chunk-AMX4CR2E.js";
17
17
  import {
18
18
  WhatsAppAdapter
19
19
  } from "./chunk-ECSNSHZ7.js";
@@ -42,7 +42,7 @@ import {
42
42
  retryWithBackoff,
43
43
  routeMessage,
44
44
  validateGatewayConfig
45
- } from "./chunk-3J4AJLED.js";
45
+ } from "./chunk-RZJMEZD2.js";
46
46
  import {
47
47
  OllamaProvider
48
48
  } from "./chunk-FWFFZGSC.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-COUXA2IQ.js";
4
4
  import {
5
5
  updateTask
6
- } from "./chunk-F6LDN5XB.js";
6
+ } from "./chunk-SKE3GZIB.js";
7
7
  import {
8
8
  ensureEmployee,
9
9
  extractRootExe,
@@ -14,7 +14,7 @@ import {
14
14
  sessionScopeFilter,
15
15
  strictSessionScopeFilter,
16
16
  writeNotification
17
- } from "./chunk-SNTCGJAE.js";
17
+ } from "./chunk-K7ZSU4DV.js";
18
18
  import {
19
19
  queueIntercom
20
20
  } from "./chunk-TXSJ2L5O.js";
@@ -611,7 +611,7 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
611
611
  `
612
612
  );
613
613
  try {
614
- const { writeNotification: writeNotification2 } = await import("./notifications-WNSNHFH6.js");
614
+ const { writeNotification: writeNotification2 } = await import("./notifications-D4SRWBIW.js");
615
615
  await writeNotification2({
616
616
  agentId,
617
617
  agentRole: "employee",
@@ -639,6 +639,17 @@ async function pollOrphanedTasks(deps, nowMs = Date.now()) {
639
639
  } catch (e) {
640
640
  process.stderr.write("[daemon-orch] mark task blocked after retries: " + (e instanceof Error ? e.message : String(e)) + "\n");
641
641
  }
642
+ try {
643
+ await writeNotification({
644
+ agentId,
645
+ agentRole: "employee",
646
+ event: "orphan_task",
647
+ project: String(topTask.sessionScope ?? ""),
648
+ summary: `\u26A0\uFE0F Task ${topTask.taskId} for ${agentId} blocked after ${AUTO_WAKE_MAX_RETRIES} auto-wake failures. Manual intervention required.`,
649
+ sessionScope
650
+ });
651
+ } catch {
652
+ }
642
653
  continue;
643
654
  }
644
655
  process.stderr.write(
@@ -1075,37 +1086,65 @@ ${paneContent.slice(0, 500)}` : ""
1075
1086
  };
1076
1087
  }
1077
1088
  var ORPHAN_SIGKILL_DELAY_MS = 5e3;
1089
+ var ORPHAN_MAX_AGE_SECS = 120;
1078
1090
  var ORPHAN_PATTERNS = [
1079
1091
  "exe-os/dist/mcp/server.js",
1080
1092
  "exe-mem/dist/mcp/server.js",
1081
1093
  "exe-os/dist/hooks/ingest-worker.js",
1082
1094
  "exe-mem/dist/hooks/ingest-worker.js",
1083
- // Hook processes that become orphaned (PPID=1) and never get reaped.
1084
- // These accumulate at ~45MB each and caused 1.2GB+ memory waste (2026-05-29).
1095
+ // Hook processes that become orphaned and never get reaped.
1096
+ // These accumulate at ~70MB each and caused 1GB+ memory waste.
1097
+ "codex-stop-task-finalizer.js",
1098
+ "scan-tasks.js",
1099
+ "exe-pending-reviews.js",
1100
+ "exe-pending-messages.js",
1101
+ "exe-pending-notifications.js"
1102
+ ];
1103
+ var HOOK_PROCESS_PATTERNS = [
1085
1104
  "codex-stop-task-finalizer.js",
1086
1105
  "scan-tasks.js",
1087
1106
  "exe-pending-reviews.js",
1088
1107
  "exe-pending-messages.js",
1089
1108
  "exe-pending-notifications.js"
1090
1109
  ];
1110
+ function parseEtime(etime) {
1111
+ const trimmed = etime.trim();
1112
+ const dayMatch = trimmed.match(/^(\d+)-(\d+):(\d+):(\d+)$/);
1113
+ if (dayMatch) {
1114
+ return parseInt(dayMatch[1], 10) * 86400 + parseInt(dayMatch[2], 10) * 3600 + parseInt(dayMatch[3], 10) * 60 + parseInt(dayMatch[4], 10);
1115
+ }
1116
+ const parts = trimmed.split(":").map((p) => parseInt(p, 10));
1117
+ if (parts.length === 3) return parts[0] * 3600 + parts[1] * 60 + parts[2];
1118
+ if (parts.length === 2) return parts[0] * 60 + parts[1];
1119
+ if (parts.length === 1) return parts[0];
1120
+ return 0;
1121
+ }
1091
1122
  function reapOrphanedMcpProcesses(deps) {
1092
1123
  const lines = deps.listProcesses();
1093
1124
  const reaped = [];
1094
1125
  for (const line of lines) {
1095
1126
  const trimmed = line.trim();
1096
- const match = trimmed.match(/^(\d+)\s+1\s+(.+)$/);
1127
+ const match = trimmed.match(/^(\d+)\s+(\d+)\s+(\S+)\s+(.+)$/);
1097
1128
  if (!match) continue;
1098
1129
  const pid = parseInt(match[1], 10);
1099
- const args = match[2];
1130
+ const ppid = parseInt(match[2], 10);
1131
+ const etime = match[3];
1132
+ const args = match[4];
1100
1133
  if (pid === deps.selfPid) continue;
1101
- if (!ORPHAN_PATTERNS.some((pat) => args.includes(pat))) continue;
1134
+ const isPpid1Orphan = ppid === 1 && ORPHAN_PATTERNS.some((pat) => args.includes(pat));
1135
+ const ageSecs = parseEtime(etime);
1136
+ const isAgedHookOrphan = ageSecs > ORPHAN_MAX_AGE_SECS && HOOK_PROCESS_PATTERNS.some((pat) => args.includes(pat));
1137
+ if (!isPpid1Orphan && !isAgedHookOrphan) continue;
1102
1138
  try {
1103
1139
  deps.killProcess(pid, "SIGTERM");
1104
1140
  } catch {
1105
1141
  continue;
1106
1142
  }
1107
- const desc = `PID ${pid} (${args.slice(0, 100)})`;
1143
+ const reason = isPpid1Orphan ? "ppid=1" : `age=${ageSecs}s`;
1144
+ const desc = `PID ${pid} (${reason}, ${args.slice(0, 100)})`;
1108
1145
  reaped.push(desc);
1146
+ process.stderr.write(`[orphan-reaper] Killed ${desc}
1147
+ `);
1109
1148
  deps.scheduleKill(pid, ORPHAN_SIGKILL_DELAY_MS, () => {
1110
1149
  try {
1111
1150
  deps.killProcess(pid, "SIGKILL");
@@ -1118,7 +1157,7 @@ function reapOrphanedMcpProcesses(deps) {
1118
1157
  function createOrphanReaperRealDeps() {
1119
1158
  return {
1120
1159
  listProcesses: () => {
1121
- const output = execSync("ps -eo pid,ppid,args", {
1160
+ const output = execSync("ps -eo pid,ppid,etime,args", {
1122
1161
  encoding: "utf8",
1123
1162
  timeout: 5e3
1124
1163
  });
@@ -1178,7 +1217,9 @@ export {
1178
1217
  pollCoordinatorContextRestart,
1179
1218
  createCoordinatorRestartRealDeps,
1180
1219
  ORPHAN_SIGKILL_DELAY_MS,
1220
+ ORPHAN_MAX_AGE_SECS,
1181
1221
  ORPHAN_PATTERNS,
1222
+ HOOK_PROCESS_PATTERNS,
1182
1223
  reapOrphanedMcpProcesses,
1183
1224
  createOrphanReaperRealDeps
1184
1225
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  processCRMEvent
3
- } from "./chunk-JC7GZZVA.js";
3
+ } from "./chunk-5MOAOYG6.js";
4
4
 
5
5
  // src/gateway/adapters/crm-webhook.ts
6
6
  function parseTwentyWebhook(payload) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  vectorToBlob
3
- } from "./chunk-CSTCUDVM.js";
3
+ } from "./chunk-BHYRHHKG.js";
4
4
  import {
5
5
  isCoordinatorName
6
6
  } from "./chunk-JTS3IDOY.js";
@@ -9,14 +9,14 @@ import {
9
9
  } from "./chunk-DHNTMNKR.js";
10
10
  import {
11
11
  AUTO_WAKE_MAX_RETRIES
12
- } from "./chunk-IKDK7NXN.js";
12
+ } from "./chunk-7N2VDN76.js";
13
13
  import {
14
14
  isToolAllowed,
15
15
  isToolAllowedForPlan
16
16
  } from "./chunk-E6ORBQHP.js";
17
17
  import {
18
18
  listRecentSessionEvents
19
- } from "./chunk-VUBQUWJH.js";
19
+ } from "./chunk-VJ6OHRKJ.js";
20
20
  import {
21
21
  isRerankerAvailable,
22
22
  rerankWithScores
@@ -52,7 +52,7 @@ import {
52
52
  } from "./chunk-DH65L4XI.js";
53
53
  import {
54
54
  createOrRefreshResumeTask
55
- } from "./chunk-VLQKYNIO.js";
55
+ } from "./chunk-XTMKDKYH.js";
56
56
  import {
57
57
  registerListReminders
58
58
  } from "./chunk-TLTQGQCX.js";
@@ -64,16 +64,16 @@ import {
64
64
  } from "./chunk-D5PHT3JX.js";
65
65
  import {
66
66
  registerSendMessage
67
- } from "./chunk-NABY2RI6.js";
67
+ } from "./chunk-U2NOATX5.js";
68
68
  import {
69
69
  registerCreateTask
70
- } from "./chunk-ACRIYPBC.js";
70
+ } from "./chunk-44FRIHFS.js";
71
71
  import {
72
72
  registerListTasks
73
- } from "./chunk-IJXYCSUR.js";
73
+ } from "./chunk-SBDMN3UH.js";
74
74
  import {
75
75
  registerUpdateTask
76
- } from "./chunk-5HVWTVZI.js";
76
+ } from "./chunk-IDJ6ZZ6A.js";
77
77
  import {
78
78
  registerCreateReminder
79
79
  } from "./chunk-PZWRXJBJ.js";
@@ -85,10 +85,10 @@ import {
85
85
  import {
86
86
  createSchedule,
87
87
  parseHumanCron
88
- } from "./chunk-SI7P22A5.js";
88
+ } from "./chunk-V746MLQJ.js";
89
89
  import {
90
90
  status
91
- } from "./chunk-2PI3WQ47.js";
91
+ } from "./chunk-4WH3U6YR.js";
92
92
  import {
93
93
  TOKENS_PER_IDLE_MINUTE,
94
94
  countKillsSince,
@@ -108,7 +108,7 @@ import {
108
108
  import {
109
109
  formatReport,
110
110
  runAudit
111
- } from "./chunk-ARTF7DMV.js";
111
+ } from "./chunk-EYPMCM34.js";
112
112
  import {
113
113
  runHealthCheck
114
114
  } from "./chunk-J73N5EJ6.js";
@@ -132,7 +132,7 @@ import {
132
132
  groupMemories,
133
133
  runConsolidation,
134
134
  selectUnconsolidated
135
- } from "./chunk-FVQ7BELN.js";
135
+ } from "./chunk-AV3BIPWB.js";
136
136
  import {
137
137
  renderClientCOOTemplate
138
138
  } from "./chunk-AGBFY64D.js";
@@ -149,7 +149,7 @@ import {
149
149
  cloudSync,
150
150
  getCloudReuploadRequired,
151
151
  markCloudReuploadRequired
152
- } from "./chunk-OYQHH5SX.js";
152
+ } from "./chunk-P5VV55Y6.js";
153
153
  import {
154
154
  createARecord
155
155
  } from "./chunk-X2Z5GT3V.js";
@@ -163,17 +163,17 @@ import {
163
163
  } from "./chunk-T5YT64SZ.js";
164
164
  import {
165
165
  updateTask
166
- } from "./chunk-F6LDN5XB.js";
166
+ } from "./chunk-SKE3GZIB.js";
167
167
  import {
168
168
  fastDbInit
169
- } from "./chunk-NGVIZCGB.js";
169
+ } from "./chunk-OI4LP6IC.js";
170
170
  import {
171
171
  MAX_CONCURRENT_WORKERS
172
- } from "./chunk-CQFBWHQT.js";
172
+ } from "./chunk-OAXVEPFZ.js";
173
173
  import {
174
174
  hybridSearch,
175
175
  recentRecords
176
- } from "./chunk-BOAP6EJD.js";
176
+ } from "./chunk-52JA6FT3.js";
177
177
  import {
178
178
  getActiveAgent
179
179
  } from "./chunk-XFA26MHB.js";
@@ -184,7 +184,7 @@ import {
184
184
  reserveVersions,
185
185
  vectorToBlob,
186
186
  writeMemory
187
- } from "./chunk-CSTCUDVM.js";
187
+ } from "./chunk-BHYRHHKG.js";
188
188
  import {
189
189
  getMySession,
190
190
  resolveExeSession,
@@ -192,7 +192,7 @@ import {
192
192
  sessionScopeFilter,
193
193
  updateTaskStatus,
194
194
  writeCheckpoint
195
- } from "./chunk-SNTCGJAE.js";
195
+ } from "./chunk-K7ZSU4DV.js";
196
196
  import {
197
197
  listSessions
198
198
  } from "./chunk-64WZEXXA.js";
@@ -225,7 +225,7 @@ import {
225
225
  isScheduledTrigger,
226
226
  loadTriggers,
227
227
  sanitizeParam
228
- } from "./chunk-JC7GZZVA.js";
228
+ } from "./chunk-5MOAOYG6.js";
229
229
  import {
230
230
  pushConversationToCRM
231
231
  } from "./chunk-ONKIWA3R.js";
@@ -913,7 +913,7 @@ async function searchConversations(query, limit) {
913
913
  }
914
914
  async function searchWiki(query, limit) {
915
915
  try {
916
- const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-NZR7RW4I.js");
916
+ const { createWikiClient, chatInWorkspace, listWorkspaces } = await import("./wiki-client-S6JKY7GG.js");
917
917
  const client = await createWikiClient();
918
918
  if (!client) return [];
919
919
  const workspaces = await listWorkspaces(client);
@@ -1568,7 +1568,7 @@ function registerMemory(server) {
1568
1568
  if (action === "core_get" || action === "core_set" || action === "core_delete") {
1569
1569
  const { getActiveAgent: getActiveAgent2 } = await import("./active-agent-XAA2YRRH.js");
1570
1570
  const { agentId } = getActiveAgent2();
1571
- const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-TFPUGGWO.js");
1571
+ const { getCoreMemory, setCoreMemory, deleteCoreMemory, formatCoreMemoryBlock } = await import("./core-memory-LC4CCGI2.js");
1572
1572
  if (action === "core_get") {
1573
1573
  const entries = await getCoreMemory(agentId);
1574
1574
  const block = formatCoreMemoryBlock(entries);
@@ -2177,7 +2177,7 @@ function registerResumeEmployee(server) {
2177
2177
  };
2178
2178
  }
2179
2179
  try {
2180
- const { isTmuxSessionAlive } = await import("./tasks-crud-NQLF7DVV.js");
2180
+ const { isTmuxSessionAlive } = await import("./tasks-crud-KJ5P3AWZ.js");
2181
2181
  const now = (/* @__PURE__ */ new Date()).toISOString();
2182
2182
  for (const row of openTasks.rows) {
2183
2183
  const status2 = String(row.status);
@@ -5336,7 +5336,7 @@ async function getAgentSessionLoad() {
5336
5336
  return { sessions: [], totalLive: 0, busySessions: 0, idleSessions: 0 };
5337
5337
  }
5338
5338
  const { getClient: getClient2 } = await import("./lib/database.js");
5339
- const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-3UOAF4QQ.js");
5339
+ const { sessionScopeFilter: sessionScopeFilter2 } = await import("./task-scope-54WKRGBQ.js");
5340
5340
  const client = getClient2();
5341
5341
  const scope = sessionScopeFilter2();
5342
5342
  for (const s of liveAgentSessions) {
@@ -9375,7 +9375,7 @@ function registerWorkflowTool(server) {
9375
9375
  getWorkflowInstance,
9376
9376
  listWorkflowInstances,
9377
9377
  approveWorkflowStep
9378
- } = await import("./workflow-engine-4U4H4V6K.js");
9378
+ } = await import("./workflow-engine-U3LC77BS.js");
9379
9379
  try {
9380
9380
  switch (input.action) {
9381
9381
  case "create_workflow": {
@@ -830,7 +830,7 @@ function formatReport(report, flags) {
830
830
  return lines.join("\n");
831
831
  }
832
832
  async function fixNullVectors() {
833
- const { tryAcquireWorkerSlot, registerWorkerPid } = await import("./worker-gate-J5RRT27H.js");
833
+ const { tryAcquireWorkerSlot, registerWorkerPid } = await import("./worker-gate-GB6MR4AC.js");
834
834
  if (!tryAcquireWorkerSlot()) {
835
835
  process.stderr.write("[exe-doctor] Worker gate full \u2014 waiting for existing backfill workers to finish\n");
836
836
  await new Promise((r) => setTimeout(r, 5e3));
@@ -951,7 +951,7 @@ function splitAtSentences(text, maxChunkSize) {
951
951
  }
952
952
  async function main(argv = process.argv.slice(2)) {
953
953
  const flags = parseFlags(argv);
954
- const { fastDbInit } = await import("./fast-db-init-43JVJVVH.js");
954
+ const { fastDbInit } = await import("./fast-db-init-OLKGFPSS.js");
955
955
  const client = await fastDbInit();
956
956
  const report = await runAudit(client, flags);
957
957
  console.log(formatReport(report, flags));
@@ -4,7 +4,7 @@ import {
4
4
  resolveExeSession,
5
5
  sendIntercom,
6
6
  strictSessionScopeFilter
7
- } from "./chunk-SNTCGJAE.js";
7
+ } from "./chunk-K7ZSU4DV.js";
8
8
  import {
9
9
  getClient
10
10
  } from "./chunk-JTS3IDOY.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  sessionScopeFilter
3
- } from "./chunk-SNTCGJAE.js";
3
+ } from "./chunk-K7ZSU4DV.js";
4
4
 
5
5
  // src/lib/git-task-sweep.ts
6
6
  import { execSync } from "child_process";
@@ -178,7 +178,7 @@ async function sweepTasks(projectName, options = {}) {
178
178
  }
179
179
  if (!dryRun) {
180
180
  try {
181
- const { updateTaskStatus } = await import("./tasks-crud-NQLF7DVV.js");
181
+ const { updateTaskStatus } = await import("./tasks-crud-KJ5P3AWZ.js");
182
182
  await updateTaskStatus({
183
183
  taskId: task.id,
184
184
  status: "needs_review",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MultiAgentOrchestrator
3
- } from "./chunk-EEH5SNIW.js";
3
+ } from "./chunk-RVVG5QOG.js";
4
4
  import {
5
5
  createQuietRenderer,
6
6
  createTerminalRenderer,
@@ -327,7 +327,7 @@ function createExeOSHooks(config) {
327
327
  async onSubagentStop(_reason) {
328
328
  try {
329
329
  const { getClient } = await import("./lib/database.js");
330
- const { sessionScopeFilter } = await import("./task-scope-3UOAF4QQ.js");
330
+ const { sessionScopeFilter } = await import("./task-scope-54WKRGBQ.js");
331
331
  const client = getClient();
332
332
  const ehScope = sessionScopeFilter();
333
333
  const tasks = await client.execute({
@@ -419,7 +419,7 @@ function createExeOSHooks(config) {
419
419
  try {
420
420
  const { writeMemory, flushBatch } = await import("./lib/store.js");
421
421
  const { getClient } = await import("./lib/database.js");
422
- const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-3UOAF4QQ.js");
422
+ const { sessionScopeFilter: cpScopeFilter } = await import("./task-scope-54WKRGBQ.js");
423
423
  const client = getClient();
424
424
  const cpScope = cpScopeFilter();
425
425
  const tasks = await client.execute({
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  updateTask
3
- } from "./chunk-F6LDN5XB.js";
3
+ } from "./chunk-SKE3GZIB.js";
4
4
  import {
5
5
  TASK_ALREADY_CLAIMED_PREFIX
6
- } from "./chunk-SNTCGJAE.js";
6
+ } from "./chunk-K7ZSU4DV.js";
7
7
 
8
8
  // src/mcp/tools/update-task.ts
9
9
  import { z } from "zod";
@@ -359,7 +359,7 @@ async function createTaskCore(input) {
359
359
  if (isCoordinatorSession) {
360
360
  earlySessionScope = resolved;
361
361
  } else {
362
- const { getSessionProject } = await import("./session-scope-TU7M4FAA.js");
362
+ const { getSessionProject } = await import("./session-scope-CWBSZTZM.js");
363
363
  const sessionProject = getSessionProject(resolved);
364
364
  if (sessionProject && sessionProject !== input.projectName) {
365
365
  scopeMismatchWarning = `session/project mismatch: session "${resolved}" owns "${sessionProject}" but task targets "${input.projectName}". Routed to default scope.`;
@@ -620,7 +620,7 @@ function getProjectNameSafe() {
620
620
  }
621
621
  }
622
622
  async function listTasks(input) {
623
- const rows = await queryTaskRows({
623
+ const queryOpts = {
624
624
  assignedTo: input.assignedTo,
625
625
  status: input.status || void 0,
626
626
  projectName: input.projectName || void 0,
@@ -631,7 +631,21 @@ async function listTasks(input) {
631
631
  // When no status filter, listTasks defaults to active + blocked
632
632
  ...input.status ? {} : { status: ["open", "in_progress", "blocked"] },
633
633
  ...input.priority ? { extraConditions: ["priority = ?"], extraArgs: [input.priority] } : {}
634
- });
634
+ };
635
+ let rows = await queryTaskRows(queryOpts);
636
+ if (rows.length === 0 && !input.crossSession && input.assignedTo) {
637
+ const unscopedRows = await queryTaskRows({
638
+ ...queryOpts,
639
+ sessionScope: null
640
+ });
641
+ if (unscopedRows.length > 0) {
642
+ process.stderr.write(
643
+ `[list-tasks] WARN: Session-scoped query returned 0 for ${input.assignedTo} but unscoped found ${unscopedRows.length}. Possible session_scope mismatch after daemon restart. Returning unscoped results.
644
+ `
645
+ );
646
+ rows = unscopedRows;
647
+ }
648
+ }
635
649
  return rows.map((r) => ({
636
650
  id: String(r.id),
637
651
  title: String(r.title),
@@ -769,7 +783,7 @@ async function updateTaskStatus(input) {
769
783
  } catch {
770
784
  }
771
785
  try {
772
- const { writeNotification: writeNotification2 } = await import("./notifications-WNSNHFH6.js");
786
+ const { writeNotification: writeNotification2 } = await import("./notifications-D4SRWBIW.js");
773
787
  await writeNotification2({
774
788
  agentId: reviewer,
775
789
  agentRole: isCoordinatorName(reviewer) ? "COO" : "manager",
@@ -944,7 +958,7 @@ ${input.result}` : `\u26A0\uFE0F ${warning}`;
944
958
  }
945
959
  if (input.status === "done" || input.status === "needs_review") {
946
960
  try {
947
- const { incrementSkillSuccess } = await import("./skill-refinement-RRSHVVV7.js");
961
+ const { incrementSkillSuccess } = await import("./skill-refinement-QYSXB6YR.js");
948
962
  await incrementSkillSuccess(
949
963
  String(row.assigned_to),
950
964
  row.project_name ? String(row.project_name) : null
@@ -1053,13 +1067,20 @@ async function cleanOrphanedTaskFiles() {
1053
1067
  args: [relativePath]
1054
1068
  });
1055
1069
  if (result.rows.length === 0) {
1056
- const fileStat = await stat(fullPath);
1057
- const ageMs = Date.now() - fileStat.mtimeMs;
1058
- if (ageMs > 60 * 60 * 1e3) {
1059
- await unlink(fullPath);
1060
- cleaned++;
1061
- process.stderr.write(`[task-cleanup] Removed orphan task file: ${relativePath}
1070
+ const filenameBase = entry.name.replace(/\.md$/, "");
1071
+ const idCheck = await client.execute({
1072
+ sql: "SELECT id FROM tasks WHERE id LIKE ? LIMIT 1",
1073
+ args: [`${filenameBase}%`]
1074
+ });
1075
+ if (idCheck.rows.length === 0) {
1076
+ const fileStat = await stat(fullPath);
1077
+ const ageMs = Date.now() - fileStat.mtimeMs;
1078
+ if (ageMs > 24 * 60 * 60 * 1e3) {
1079
+ await unlink(fullPath);
1080
+ cleaned++;
1081
+ process.stderr.write(`[task-cleanup] Removed orphan task file: ${relativePath}
1062
1082
  `);
1083
+ }
1063
1084
  }
1064
1085
  }
1065
1086
  } catch {
@@ -2015,7 +2036,7 @@ async function verifyPaneAtCapacity(sessionName) {
2015
2036
  reason: `capture-pane failed: ${err instanceof Error ? err.message : String(err)}`
2016
2037
  };
2017
2038
  }
2018
- const { isAtCapacity } = await import("./capacity-monitor-MSQGHO27.js");
2039
+ const { isAtCapacity } = await import("./capacity-monitor-WOX3YB66.js");
2019
2040
  if (!isAtCapacity(pane)) {
2020
2041
  return {
2021
2042
  atCapacity: false,
@@ -111,7 +111,7 @@ function releaseBackfillLock() {
111
111
  }
112
112
  async function getTaskAwareCapacity() {
113
113
  const { getClient } = await import("./lib/database.js");
114
- const { sessionScopeFilter } = await import("./task-scope-3UOAF4QQ.js");
114
+ const { sessionScopeFilter } = await import("./task-scope-54WKRGBQ.js");
115
115
  const client = getClient();
116
116
  const scope = sessionScopeFilter();
117
117
  const result = await client.execute({