Repository navigation
fix(batch): workers outlive the watcher's systemd tick; ended workers are reaped - #593
Merged
Merged
Conversation
… are reaped (#592) KillMode=process on the oneshot unit: under the default control-group, systemd killed the claude --bg daemon (and every worker) when the tick exited, as happened in pilot live shift 1. claude agents states in _digest.ENDED_STATES (failed, killed, error, ...) are now a crash at once (re-dispatched once) or a refused close-out, never read as alive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pilot live shift 1 (2026-11-06, PyAutoLabs/PyAutoMind#542) lost all 3 workers about 30 seconds after spawn, with no transcripts and 0 tokens. Two bugs:
Type=oneshotwith the defaultKillMode=control-group. The firstclaude --bgstarts the background-session daemon inside the tick's cgroup, so when the tick exits, systemd kills the daemon and every worker. Fixed withKillMode=processin the unit template.failedas alive and held the dead workers' leases for 40 minutes. Now anyclaude agentsstate in_digest.ENDED_STATES(failed,killed,error, …) is a crash at once (no lease grace, since an ended session can never write a late.done): re-dispatched once, then abandoned. An ended close-out is refused.batch watchshowsended (failed, …).Closes #592
API Changes
_digest.ENDED_STATES(_orchestrator.ENDED_STATESis the same object). The unit template changed: installed copies must be copied again (daemon-reload).Witness
Type=oneshotunit spawning oneclaude --bghaiku probe:KillMode=control-group(old default):killmode-probe-control-group failedimmediately after the unit exits.KillMode=process(fix):killmode-probe-process working, laterdone._orchestrator.py, the new reaping tests fail (5 failed); with the fix they pass.failed/killed/error) is reaped at once inside its grace and re-dispatched, with tokens counted; an ended worker with its.donestill counts as done; afailedclose-out is refused; the unit template carriesKillMode=process;batch watchshows ended.Tier: glance — merge mode: auto-merge on green with Witness PASS, post-merge summary.
🤖 Generated with Claude Code