Skip to content

[Bug]: Parent subagent task and TaskFlow remain stale_running after child becomes lost #92285

Description

@elony-7

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Behavior bug: task registry and TaskFlow states become inconsistent without crashing.

While running a full-agent child task through an orchestrator, the backing child task became terminal with status: lost and error: backing session missing.

However, the mirrored parent subagent task and related TaskFlow remain marked as running. Attempting to cancel the parent task reports Task is already terminal, despite the task continuing to appear in the running-task list.

Restarting the gateway does not reconcile these stale records.

Steps to reproduce

I have observed this once, so the issue may be intermittent.

  1. Start a full-agent child task through an orchestrator using sessions_spawn.

  2. Allow the child to perform a longer-running task involving file changes, npm commands, build validation, and temporary local-server testing.

  3. Wait until the backing child session terminates, disappears, or becomes lost.

  4. Inspect the task registry:

    openclaw tasks list --status running --json
    openclaw tasks audit --json
  5. Observe that:

    • The backing child CLI task is marked lost.
    • The child reports backing session missing.
    • The mirrored parent subagent task remains marked running.
    • The related TaskFlow remains marked running.
    • Task audit reports the parent task and TaskFlow as stale_running.
  6. Attempt to cancel the parent task:

    openclaw tasks cancel <parent-task-id>
  7. Observe that cancellation reports:

    Task is already terminal.
    
  8. Restart the OpenClaw gateway.

  9. Run the task-list and audit commands again.

  10. Observe that the parent task and TaskFlow remain stale_running.

Expected behavior

When a backing child task becomes terminal or its session is missing, OpenClaw should reconcile the mirrored parent task and related TaskFlow into an appropriate terminal state, such as:

  • lost
  • failed
  • cancelled
  • timed_out
  • needs_reconciliation

Alternatively, openclaw tasks cancel or task maintenance should provide a supported way to safely reconcile the inconsistent records.

A task reported as already terminal should not continue appearing as running.

Actual behavior

  • The backing child task is terminal and reports backing session missing.
  • The mirrored parent task remains running.
  • The related TaskFlow remains running.
  • Task audit reports both records as stale_running.
  • Cancellation reports that the task is already terminal.
  • Gateway restart does not reconcile the records.

OpenClaw version

2026.6.5

Operating system

Windows 11

Install method

npm global installation

Model

Poolside: Laguna M.1

Provider / routing chain

OpenClaw Gateway (local, 127.0.0.1:18789) → OpenRouter → poolside/laguna-m.1:free.

Additional provider/model setup details

The failure concerns OpenClaw's local subagent task-registry reconciliation after the model request completed. No additional proxy or external gateway is used.

Logs, screenshots, and evidence

Impact and severity

This makes task status unreliable for multi-agent orchestration.

The orchestrator may believe that a mutating writer remains active indefinitely. Waiting blocks legitimate continuation, while starting another writer risks duplicate work or conflicting project changes.

I currently have to keep the affected project locked and treat it as requiring manual reconciliation.

Additional information

Related issues

This appears related to the following closed issues:

The issue is still reproducible on OpenClaw 2026.6.5 under Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:linked-pr-openClawSweeper 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:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, 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.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions