Skip to content

bug: subagent registry entry stuck 'active (waiting on 1 child)' 10 days after run ended — pendingDescendants never resolves #149

Description

@NOVA-Openclaw

Symptom

subagents list (and the per-turn Active Subagents context block) reports a subagent as active 10 days after it ended:

  • taskName: se375-step9-doc-audit (Scribe doc audit for SE Run fix(macOS): honor discovered gateway ports openclaw/openclaw#375)
  • sessionKey: agent:scribe:subagent:0935f353-3dd4-4497-9d1e-d2d90ec000c3
  • runId: announce:v1:agent:scribe:subagent:d10cc873-1c3a-4bda-b4d5-97b19f50063d:2cac71f1-4f0b-4887-a494-b8b738c7d00c
  • startedAt: 1783865862306 (2026-07-12 ~15:37 UTC), endedAt: 1783866626067 (~12.7 min later, same day)
  • status: active (waiting on 1 child), pendingDescendants: 1
  • Observed still 'active' on 2026-07-22 20:19 UTC (heartbeat lane agent:nova:main:heartbeat)

Notes

  • The entry has endedAt set, yet status remains active because pendingDescendants=1 never resolved — the child either died without a terminal event or its completion was never propagated to the parent's descendant counter.
  • SE Run fix(macOS): honor discovered gateway ports openclaw/openclaw#375 itself (workflow_runs id 375) completed 2026-07-12 16:14 UTC; step-9 deliverable se-runs/375-step9-doc-audit.md exists. So this is pure registry bookkeeping, not lost work.

Impact

  • The stale entry is injected into the Active Subagents system-context block on every turn of the requester session, indefinitely — permanent context pollution and misleading orchestration state ('waiting on 1 child' suggests in-flight SE work that does not exist).
  • Orchestrators following the 'call sessions_yield if completion events have not arrived' guidance could wait forever on a descendant that will never complete.

Expected

  • pendingDescendants should decay/resolve when the descendant session is gone (terminal state, expired, or transcript absent), or entries with endedAt set should age out of the active list after a TTL.
  • A reaper pass over the registry (similar in spirit to zombie-workflow-run cleanup) would cover the general case.

Possibly related

#105 (push-based orchestration continuity), #99 (sessions_yield completion-event handling).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions