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> |
||
|---|---|---|
| .. | ||
| agent-core | ||
| ai | ||
| coding-agent | ||
| daemon | ||
| google-gemini-cli-provider | ||
| native | ||
| openai-codex-provider | ||
| rpc-client | ||
| tui | ||