You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a tracked job's worker process dies between SessionStart and SessionEnd (crash, OOM, SIGKILL, parent detached), the job record stays status: "running" for the rest of the session. buildStatusSnapshot and enrichJob in plugins/opencode/scripts/lib/job-control.mjs never probe process.kill(pid, 0) — they only read the stored status field.
Cleanup today only happens in plugins/opencode/scripts/session-lifecycle-hook.mjs:27-44, which runs on SessionEnd. During the session itself, /opencode:status and /opencode:result can display rows whose PIDs are long dead.
Repro
Start a background task via /opencode:rescue --background.
kill -9 the background worker PID.
/opencode:status still shows the job as running.
Suggested fix
In enrichJob (or buildStatusSnapshot), for any job.status === "running" with a job.pid, probe with process.kill(pid, 0). On ESRCH, downgrade to failed + errorMessage: "Worker process exited without updating job status." and persist via upsertJob.
changed the title [-]Dead-PID detection missing — /opencode:status lies about crashed jobs[/-][+]Dead-PID and zombie job reconciliation[/+]on Apr 12, 2026
Consolidating zombie-job follow-ups here: #15 covers stale running rows accumulating in state, and #42 covers the reference implementation for reconciling dead PIDs during status reads. This issue is now the canonical tracker for dead-PID detection plus zombie state cleanup.
Activity
[-]Dead-PID detection missing — /opencode:status lies about crashed jobs[/-][+]Dead-PID and zombie job reconciliation[/+]JohnnyVicious commentedon Apr 12, 2026
Consolidating zombie-job follow-ups here: #15 covers stale running rows accumulating in state, and #42 covers the reference implementation for reconciling dead PIDs during status reads. This issue is now the canonical tracker for dead-PID detection plus zombie state cleanup.
JohnnyVicious commentedon Apr 12, 2026
Dead-PID reconciliation implemented in PR #51 commit a4e0097 (isProcessAlive probe + markDeadPidJobFailed + reconcileIfDead wired into buildStatusSnapshot/handleResult/handleCancel). Issue was a parent tracking stub; implementation is done.