singularity-forge/packages/coding-agent
Mikael Hugo 55a498603f fix(rpc): don't unref the sf-feedback drain timer
The drainer was scheduled via setTimeout(0) with timer.unref(). The unref
made the timer release-eligible — fine in a long-running rpc-mode child
where the process has plenty of other event-loop handles, but fatal in
the packaged-standalone path where the rpc subprocess has nothing else
to keep it alive. The process exited before the timer fired, so the
queue file was renamed to .<pid>.draining and then stranded forever.

Removed timer.unref(). The setTimeout(0) still lets the RPC response go
back to the caller first (no synchronous blocking on the drain), but the
timer now keeps the process alive until the drain handler runs, and the
drain's own async I/O keeps it alive until done.

Refs sf-mpa6wuhm-wwddd1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:55:23 +02:00
..
scripts feat(web): add error boundaries, expand test coverage, add README 2026-05-10 11:24:40 +02:00
src fix(rpc): don't unref the sf-feedback drain timer 2026-05-17 21:55:23 +02:00
package.json chore(release): 2.75.3 → 2.75.4 + workspace dependency refresh 2026-05-16 23:59:14 +02:00
tsconfig.json sf snapshot: uncommitted changes after 268m inactivity 2026-05-15 02:08:06 +02:00