niahere 0.5.9 → 0.5.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "niahere",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "A personal AI assistant daemon — chat, scheduled jobs, persona system, extensible via skills.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -272,8 +272,12 @@ export async function runHealthChecks(): Promise<Check[]> {
272
272
  // Replies written but never confirmed sent. 25 code paths write this column
273
273
  // and, until now, nothing read it.
274
274
  try {
275
+ // withDb, not a bare getSql(): the CLI must be able to exit afterwards, and
276
+ // a lazily-opened connection nobody closes keeps the event loop alive.
277
+ const { withDb } = await import("../db/with-db");
275
278
  const { Message } = await import("../db/models");
276
- checks.push(auditDelivery(await Message.listPendingDeliveries()));
279
+ const pending = await withDb(() => Message.listPendingDeliveries());
280
+ checks.push(auditDelivery(pending));
277
281
  } catch (err) {
278
282
  checks.push({ name: "delivery", status: "warn", detail: errMsg(err) });
279
283
  }