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
{{ message }}
Repository navigation
fix(batch): live workers die with the watcher's systemd tick; failed workers never reaped #592
Pilot live shift 1 (2026-11-06, PyAutoLabs/PyAutoMind#542; pilot #574): all 3 workers were spawned at 10:10:30 and were failed by about 10:11 with no transcript and 0 tokens.
systemd kills them.pyauto-orchestrator.service is Type=oneshot with the default KillMode=control-group. The first claude --bg starts the background-session daemon inside the tick's cgroup, so when the tick exits, systemd kills the daemon and every worker. (claude logs: connect ENOENT …/control.sock.) Phase 3b only ever spawned from an interactive shell.
The watcher can't see a dead worker._reap reads any claude agents state other than blocked/done/unlisted as alive, so the 3 failed workers held their leases for 40 minutes, shown as "running". Close-outs have the same gap.
Plan
bin/systemd/pyauto-orchestrator.service: KillMode=process, so only the tick itself is stopped and the workers and daemon outlive it. The human recopies the unit.
_orchestrator: ENDED_STATES (failed, error, killed, stopped, …). An ended real worker with no .done is a crash at once (no grace: it can never write one): re-dispatched once, then abandoned. An ended close-out is refused.
_digest._lease_state / batch watch: an ended worker shows ended (failed), not running.
Tests: a failed worker is reaped as a crash and re-dispatched; a failed close-out is refused; the unit template carries KillMode=process. Manual: one systemd tick that spawns a real claude --bg stub, which outlives the tick.
Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary (a non-PASS Witness → human /prm).
Merged in #593 (a55960c3) as a glance-tier in-turn merge: Witness PASS (real systemd check plus a control), CI green, Heart STALE acknowledged by the human. Installed units must be copied again (daemon-reload) to pick up KillMode=process.
Activity
Jammy2211 commentedon Nov 6, 2026
Shipped
Merged in #593 (
a55960c3) as a glance-tier in-turn merge: Witness PASS (real systemd check plus a control), CI green, Heart STALE acknowledged by the human. Installed units must be copied again (daemon-reload) to pick upKillMode=process.Revert:
git revert -m 1 a55960c3in PyAutoBrain.🤖 Generated with Claude Code