-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Bug: Subagent child sessions receive no termination signal when parent dies mid-run #77720
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Summary
When a subagent session dies mid-run (OOM kill, SIGUSR1 restart, or abrupt failed exit), its active child sub-subagent sessions receive no termination signal. Children sit in `stale_running` indefinitely — the gateway marks them "running" but no agent polls them and they never complete. Only manual cancellation or `openclaw maintenance --apply` cleans them up.
Steps to Reproduce
Expected Behavior
When a parent session dies, all its descendant sessions should either:
Actual Behavior
Depth-2 children become orphaned with no lineage connection to a living agent. Gateway shows them as `running` but they are never polled again. `openclaw tasks audit` reports `stale_running` indefinitely.
Version
```
OpenClaw 2026.5.3-1 (2eae30e)
```
OS: Linux 6.8.0-110-generic (x64)
Evidence
Live task IDs from a production instance (anonymized session keys):
`openclaw tasks audit` output:
Impact
Severity
High — reliability/usability of multi-agent orchestration.
Proposed Fix (direction, not prescriptive)
Option A: Gateway tracks parent→child registry; on parent death, iterate children and send termination signal or mark them `orphaned`.
Option B: Subagent children monitor parent session heartbeat; if parent goes dark for N consecutive heartbeats, child self-terminates with a defined exit state.
Either approach closes the lifecycle management gap without changing the spawn permission model.
Related Issues
See also: