task --background: detached worker has no timeout or stall watchdog

Author: TahseenChowdhuryCreated Jul 17, 2026Updated Sep 15, 2026

codex-companion.mjs task --background spawns a detached worker (spawnDetachedTaskWorker, stdio: "ignore", unref()) whose run path (runTrackedJobexecuteTaskRunrunAppServerTurnawait state.completion) has no wall-clock timeout, stall detection, or watchdog of any kind. The only timers in the runtime are the 250 ms completion-inference debounce, the transfer-import timeout, and the status --wait polling cap — none bound the job itself.

Observed in practice: a background review job hit an API/network stall and sat 52 minutes with zero log progress, never self-terminating; it had to be found and cancelled manually. A detached background job that can outlive any reasonable turn deserves either a configurable per-task timeout or a no-progress watchdog (kill + surface after N minutes without app-server events), so callers don't have to babysit job logs.

Version: plugin as shipped with codex-cli 0.144.4.