Merge tool health drain repair into Discord command scheduling

Co-Authored-By: Paperclip <noreply@paperclip.ing>

* codex/sleep-18-tool-connection-health:
  fix(server): release settled tool health intent during drain
This commit is contained in:
DottaandPaperclip committed 2026-10-25 09:55:23 -05:00
commit 7d89e7691f
3 files changed
+38 -2

No files matched your search

@@ -82,7 +82,9 @@ export function registerToolConnectionHealthWork(
if (due.length > batch.entries.length) earliest = Date.now() + 1_000;
if (errors.length) throw new AggregateError(errors, "Tool connection health checks could not settle");
},
hasPending: async () => dirty.size > 0,
// Keep the hints/deadlines for resume, but release settled intent while
// paused. The coordinator independently fences unresolved transactions.
hasPending: async () => canRun() && dirty.size > 0,
nextRunAt: next,
});
}