fix(daemon): defer hot-reload drain until in-flight runs complete #135

Merged
xiaomo merged 1 commits from fix/134-hot-reload-in-flight into main 2026-04-25 05:38:53 +00:00

1 Commits

Author SHA1 Message Date
xiaoju 8f1389defe fix(daemon): defer hot-reload drain until in-flight runs complete
When a workflow file changes while runs are active, defer the
drain+respawn until all active threads finish instead of immediately
killing them.

- Add drainWhenIdle() with pendingDrains tracking
- Wire maybeDeferredHotReloadDrain into thread-event and workflow-error paths
- Clean up pendingDrains on worker crash and stop()
- 6 new test cases in hot-reload.test.ts

Fixes #134
2026-04-25 05:37:13 +00:00