-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: orphan recovery can resurrect stale subagent runs after long downtime #90766
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.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.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
After restart, orphan recovery can treat very old subagent runs as resumable work instead of aging them out and marking them stale.
Steps to reproduce
Expected behavior
Old orphaned subagent runs should age out after the recovery staleness window and be marked stale or failed instead of being resumed automatically.
Actual behavior
The orphan-recovery path can still classify stale runs as active/recoverable and attempt replay/resume after restart.
OpenClaw version
2026.4.8
Operating system
Linux 6.8.0-107-generic
Install method
pnpm global
Model
openai-codex/gpt-5.4 (issue is subagent lifecycle dependent, not model-specific)
Provider / routing chain
openclaw -> OpenAI (provider path not required for reproduction)
Additional provider/model setup details
Observed in a self-hosted Linux gateway while auditing subagent restart recovery. The issue is in subagent lifecycle recovery rather than model/provider behavior.
Logs, screenshots, and evidence
Impact and severity
Affected: deployments that use subagents and experience restarts or downtime during child-task execution
Severity: High (can replay stale work and produce misleading late completions)
Frequency: Observed when an orphaned child survives past the staleness window and recovery runs after restart
Consequence: users can receive duplicate or contextless child-task work long after the original run should have been retired
Additional information
This looks adjacent to, but distinct from,
#90444/#90505. Those cover killed subagent task-row finalization. This report is about restart-time orphan recovery misclassifying stale child runs as resumable.