openclaw - ✅(Solved) Fix [Bug]: Race condition in subagent/session cleanup causes late child stdout to hit cleared active run, leading to announce timeout, missing-session-entry, and orphaned child processes [3 pull requests, 3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61741Fetched 2026-04-08 02:55:07
View on GitHub
Comments
3
Participants
3
Timeline
9
Reactions
0
Author
Timeline (top)
cross-referenced ×4commented ×3labeled ×2

We are seeing a recurring lifecycle failure in OpenClaw where a subagent or exec child still emits stdout/update events after the parent run/session has already been ended, patched away, or deleted.

The first hard error is:

Agent listener invoked outside active run

After that, the failure cascades into symptoms such as:

  • subagent announce timeout
  • gateway websocket handshake timeout / closed before connect
  • Subagent orphan run pruned ... reason=missing-session-entry

In at least one observed case, a Claude Code child process continued running after its wrapper/supervision chain disappeared and was reparented to PID 1. This suggests the runtime lost ownership of the child before stdout/update draining and completion handoff were fully finished.

This does not appear to require a plugin update or a gateway restart to trigger. The same error chain also appears in incident windows without a nearby restart.

Error Message

2026-04-06T14:13:41.117+07:00 [openclaw] Unhandled promise rejection: Error: Agent listener invoked outside active run at Agent.processEvents (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:533:10) at file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:380:21 at Object.onUpdate (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:539:7) at emitUpdate (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1524:8) at handleStdout (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1546:4) at Object.onSupervisorStdout [as onStdout] (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1610:3) at file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1007:21 at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:568:4) at Socket.emit (node:events:519:28) at addChunk (node:internal/streams/readable:561:12)

Root Cause

We are seeing a recurring lifecycle failure in OpenClaw where a subagent or exec child still emits stdout/update events after the parent run/session has already been ended, patched away, or deleted.

The first hard error is:

Agent listener invoked outside active run

After that, the failure cascades into symptoms such as:

  • subagent announce timeout
  • gateway websocket handshake timeout / closed before connect
  • Subagent orphan run pruned ... reason=missing-session-entry

In at least one observed case, a Claude Code child process continued running after its wrapper/supervision chain disappeared and was reparented to PID 1. This suggests the runtime lost ownership of the child before stdout/update draining and completion handoff were fully finished.

This does not appear to require a plugin update or a gateway restart to trigger. The same error chain also appears in incident windows without a nearby restart.

Fix Action

Fix / Workaround

We are seeing a recurring lifecycle failure in OpenClaw where a subagent or exec child still emits stdout/update events after the parent run/session has already been ended, patched away, or deleted.

  1. Start a subagent or exec-backed child process that can continue emitting stdout near the end of a run.
  2. Let the parent run/session reach a completion or cleanup edge quickly, for example:
    • subagent completion
    • agent.wait
    • a run ending with stopReason=toolUse
    • a no-reply/completion path
    • session patch/delete/cleanup while child completion is still in flight
  3. Allow the child/supervisor to emit stdout or update events slightly after the parent active-run/session state has already been cleared.
  4. Observe that the runtime throws Agent listener invoked outside active run, then downstream subagent announce/resume/gateway behavior starts failing.

PR fix notes

PR #61481: fix(agents): harden OpenAI phase-aware visible text — suppress commentary partials, prevent empty final_answer fallback leak

Description (problem / solution / changelog)

Summary

  • fix phase-aware visible text extraction so an explicit final_answer block never falls back to commentary or legacy unphased text when it sanitizes to empty
  • suppress all commentary-phase partial streaming output regardless of whether extracted visible text is non-empty
  • keep session-history HTTP/SSE sanitization aligned with the hardened chat history path
  • add regression tests covering both leak paths and the session-history follow-through

Context

This hardens the merged #59643 behavior against two P1 leaks:

  • fixes #61474
  • fixes #61475

Related issues / bug family

  • related to #25592
  • related to #59536
  • related to #59918
  • related to #44213
  • related to #49438
  • related to #53960

Parent / sibling PRs

  • parent: #59643 — core phase-separation fix (merged)
  • sibling: #61463 — phase-aware extraction in sessions-helpers, TUI, and history paths

Remaining follow-ups from the same adversarial review

  • #61476 — replay splitting corrupts phase on mixed messages
  • #61477 — late-map buffering gates on key existence, not phase validity
  • #61478 — function-call replay silently loses malformed arguments

Related open PRs

  • #59920 — prefer terminal reply fields in CLI JSONL parser
  • #61151 — drop partialJson streaming artifacts from session history
  • #61337 — disable OpenAI tool-use pairing repair

Testing

  • npm exec -- node --no-maglev ./node_modules/vitest/vitest.mjs run --config vitest.config.ts src/agents/pi-embedded-utils.test.ts src/agents/pi-embedded-subscribe.handlers.messages.test.ts
  • npm exec -- node --no-maglev ./node_modules/vitest/vitest.mjs run --config vitest.config.ts src/gateway/sessions-history-http.test.ts

Changed files

  • .agents/skills/openclaw-parallels-smoke/SKILL.md (modified, +13/-0)
  • .agents/skills/openclaw-qa-testing/SKILL.md (added, +86/-0)
  • .agents/skills/openclaw-qa-testing/agents/openai.yaml (added, +4/-0)
  • .github/labeler.yml (modified, +4/-0)
  • .github/workflows/ci.yml (modified, +7/-1)
  • .github/workflows/control-ui-locale-refresh.yml (modified, +2/-2)
  • .github/workflows/openclaw-npm-release.yml (modified, +1/-1)
  • CHANGELOG.md (modified, +40/-12)
  • appcast.xml (modified, +248/-116)
  • apps/android/app/build.gradle.kts (modified, +2/-2)
  • apps/ios/Config/Version.xcconfig (modified, +3/-3)
  • apps/macos/Sources/OpenClaw/Resources/Info.plist (modified, +2/-2)
  • apps/macos/Sources/OpenClawProtocol/GatewayModels.swift (modified, +14/-0)
  • apps/shared/OpenClawKit/Sources/OpenClawKit/Resources/tool-display.json (modified, +23/-0)
  • apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift (modified, +14/-0)
  • docs/.generated/config-baseline.sha256 (modified, +4/-4)
  • docs/.generated/plugin-sdk-api-baseline.sha256 (modified, +2/-2)
  • docs/automation/tasks.md (modified, +5/-0)
  • docs/channels/discord.md (modified, +1/-1)
  • docs/channels/matrix.md (modified, +29/-5)
  • docs/cli/memory.md (modified, +43/-15)
  • docs/cli/update.md (modified, +3/-1)
  • docs/concepts/dreaming.md (modified, +121/-194)
  • docs/concepts/memory-qmd.md (modified, +17/-1)
  • docs/concepts/memory-search.md (modified, +9/-8)
  • docs/concepts/memory.md (modified, +12/-8)
  • docs/concepts/model-providers.md (modified, +2/-0)
  • docs/concepts/models.md (modified, +2/-0)
  • docs/docs.json (modified, +8/-1)
  • docs/gateway/configuration-reference.md (modified, +31/-12)
  • docs/help/faq.md (modified, +36/-0)
  • docs/help/testing.md (modified, +22/-0)
  • docs/install/updating.md (modified, +1/-0)
  • docs/plugins/architecture.md (modified, +1/-0)
  • docs/plugins/building-plugins.md (modified, +1/-0)
  • docs/plugins/manifest.md (modified, +76/-30)
  • docs/plugins/sdk-migration.md (modified, +11/-1)
  • docs/plugins/sdk-overview.md (modified, +22/-9)
  • docs/providers/bedrock-mantle.md (modified, +20/-7)
  • docs/providers/bedrock.md (modified, +29/-0)
  • docs/providers/comfy.md (added, +201/-0)
  • docs/providers/fal.md (modified, +2/-1)
  • docs/providers/google.md (modified, +30/-0)
  • docs/providers/index.md (modified, +4/-0)
  • docs/providers/minimax.md (modified, +29/-0)
  • docs/providers/models.md (modified, +4/-0)
  • docs/providers/openai.md (modified, +10/-2)
  • docs/providers/runway.md (added, +63/-0)
  • docs/providers/vydra.md (added, +123/-0)
  • docs/reference/memory-config.md (modified, +117/-98)
  • docs/tools/image-generation.md (modified, +21/-17)
  • docs/tools/index.md (modified, +14/-7)
  • docs/tools/lobster.md (modified, +11/-9)
  • docs/tools/music-generation.md (added, +208/-0)
  • docs/tools/plugin.md (modified, +1/-0)
  • docs/tools/slash-commands.md (modified, +1/-1)
  • docs/tools/video-generation.md (modified, +147/-84)
  • docs/web/control-ui.md (modified, +4/-1)
  • docs/web/dashboard.md (modified, +2/-0)
  • dream-diary-preview-v2.html (added, +399/-0)
  • dream-diary-preview-v3.html (added, +323/-0)
  • extensions/amazon-bedrock-mantle/api.ts (modified, +2/-0)
  • extensions/amazon-bedrock-mantle/bedrock-token-generator.d.ts (added, +6/-0)
  • extensions/amazon-bedrock-mantle/discovery.test.ts (modified, +101/-3)
  • extensions/amazon-bedrock-mantle/discovery.ts (modified, +64/-13)
  • extensions/amazon-bedrock-mantle/package.json (modified, +3/-0)
  • extensions/bluebubbles/src/accounts.ts (modified, +5/-1)
  • extensions/bluebubbles/src/monitor.ts (modified, +1/-1)
  • extensions/browser/src/browser/chrome.default-browser.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/client-fetch.loopback-auth.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/control-service.plugin-disabled.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/profiles-service.test.ts (modified, +5/-8)
  • extensions/browser/src/browser/pw-tools-core.clamps-timeoutms-scrollintoview.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/pw-tools-core.interactions.batch.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/pw-tools-core.interactions.evaluate.abort.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/pw-tools-core.interactions.set-input-files.test.ts (modified, +2/-4)
  • extensions/browser/src/browser/pw-tools-core.last-file-chooser-arm-wins.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/pw-tools-core.screenshots-element-selector.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/routes/agent.existing-session.test.ts (modified, +3/-8)
  • extensions/browser/src/browser/routes/basic.existing-session.test.ts (modified, +3/-8)
  • extensions/browser/src/browser/server-context.existing-session.test.ts (modified, +3/-8)
  • extensions/browser/src/browser/server-context.hot-reload-profiles.test.ts (modified, +6/-12)
  • extensions/browser/src/browser/server-context.remote-profile-tab-ops.fallback.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/server-context.remote-profile-tab-ops.playwright.test.ts (modified, +2/-6)
  • extensions/browser/src/browser/server-lifecycle.test.ts (modified, +3/-8)
  • extensions/browser/src/browser/server.control-server.test-harness.ts (modified, +2/-1)
  • extensions/browser/src/browser/server.evaluate-disabled-does-not-block-storage.test.ts (modified, +3/-8)
  • extensions/browser/src/cli/browser-cli.test-support.ts (modified, +1/-1)
  • extensions/browser/src/cli/command-format.ts (modified, +1/-1)
  • extensions/browser/src/config/config.ts (modified, +1/-1)
  • extensions/browser/src/core-api.ts (modified, +25/-20)
  • extensions/browser/src/doctor-browser.ts (modified, +1/-1)
  • extensions/browser/src/gateway/auth.ts (modified, +1/-1)
  • extensions/browser/src/gateway/startup-auth.ts (modified, +1/-1)
  • extensions/browser/src/infra/errors.ts (modified, +1/-1)
  • extensions/browser/src/infra/fs-safe.ts (modified, +1/-1)
  • extensions/browser/src/infra/net/proxy-env.ts (modified, +1/-1)
  • extensions/browser/src/infra/net/ssrf.ts (modified, +1/-1)
  • extensions/browser/src/infra/path-guards.ts (modified, +1/-1)
  • extensions/browser/src/infra/ports.ts (modified, +1/-1)

PR #61801: fix(subagents): retry archived session deletes after sweep failures

Description (problem / solution / changelog)

Summary

  • make archive sweep deletion retry-safe by preserving run state until sessions.delete succeeds
  • prevent overlapping archive sweep retries while a delete is still in flight
  • keep this PR narrowly scoped to sweep retry / overlap behavior only

What this fixes

When delete-mode subagent cleanup reaches the archive sweep path, a failed sessions.delete call should not permanently lose the run record. This PR keeps the archived run entry around for retry and prevents a second sweep pass from overlapping the same in-flight delete.

What changed

  • call sessions.delete before deleting the archived run record during sweep
  • keep the archived run entry and retained attachments intact when sessions.delete fails so the next sweep can retry
  • add a sweepInProgress guard so overlapping sweep intervals do not duplicate delete attempts
  • add focused archive-sweep coverage for retry preservation and in-flight overlap protection

Scope

  • fixes the sweep retry / delete-order slice of #49000
  • does not include the startup orphan grace-window or deferred orphan recheck work; that follow-up was intentionally split out of this PR

Files changed

  • src/agents/subagent-registry.ts
  • src/agents/subagent-registry.archive.e2e.test.ts
  • src/agents/subagent-registry.persistence.test.ts

Validation

  • pnpm test src/agents/subagent-registry.persistence.test.ts
  • pnpm test src/agents/subagent-registry.archive.e2e.test.ts

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/subagent-registry.archive.e2e.test.ts (modified, +128/-0)
  • src/agents/subagent-registry.ts (modified, +74/-56)

PR #62815: fix(exec): prevent gateway crash from agent listener error

Description (problem / solution / changelog)

Summary

Fixes critical gateway crash when subprocess stdout arrives after agent run ends, causing unhandled promise rejection "Agent listener invoked outside active run".

Changes:

  • Add try-catch wrapper around opts.onUpdate() in emitUpdate()
  • Add suppression flag to prevent repeated errors after first failure
  • Proactively disable updates when exec process completes
  • Add comprehensive test coverage (5 new tests, all passing)
  • Add detailed inline documentation explaining the race condition

Fixes

  • #62746 - Gateway crash: Unhandled promise rejection
  • #62520 - Background exec output after subagent run completes
  • #62477 - Subprocess stdout arrives after agent run ends
  • #61741 - Race condition in subagent/session cleanup
  • #62435 - Gateway crash: Agent listener invoked outside active run

Root Cause

Race condition between subprocess lifecycle (exec-runtime) and agent run lifecycle (pi-agent-core). When an agent run completes and clears activeRun, any subprocess still producing stdout triggers opts.onUpdate() which calls Agent.processEvents(). Since activeRun is undefined, it throws an error that becomes an unhandled promise rejection, crashing the gateway.

Solution

Defensive guard with smart suppression:

  1. Try-catch wrapper prevents crash
  2. Suppression flag stops repeated errors
  3. Proactive disabling in promise handlers
  4. Smart logging (warn first, debug subsequent)

Test Plan

  • ✅ All 5 new tests pass (race condition, suppression, PTY, normal operation, backgrounded)
  • ✅ All 164 existing bash-tools tests pass
  • ✅ Verified exec process continues normally after error suppression
  • ✅ Verified logging provides clear context

Impact

  • Prevents gateway crashes occurring every 20-30 minutes under multi-lane operation
  • Affects all platforms (Windows, macOS, Linux)
  • Affects all channels (Telegram, Discord, Slack, WhatsApp, CLI)
  • Resolves 20+ duplicate issues

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/agents/bash-tools.exec-runtime.ts (modified, +58/-11)
  • src/agents/bash-tools.exec.on-update-lifecycle.test.ts (added, +106/-0)
  • src/agents/bash-tools.exec.pty-cleanup.test.ts (modified, +6/-6)

Code Example

2026-04-06T14:13:41.117+07:00 [openclaw] Unhandled promise rejection: Error: Agent listener invoked outside active run
    at Agent.processEvents (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:533:10)
    at file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:380:21
    at Object.onUpdate (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:539:7)
    at emitUpdate (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1524:8)
    at handleStdout (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1546:4)
    at Object.onSupervisorStdout [as onStdout] (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1610:3)
    at file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1007:21
    at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:568:4)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:561:12)
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

We are seeing a recurring lifecycle failure in OpenClaw where a subagent or exec child still emits stdout/update events after the parent run/session has already been ended, patched away, or deleted.

The first hard error is:

Agent listener invoked outside active run

After that, the failure cascades into symptoms such as:

  • subagent announce timeout
  • gateway websocket handshake timeout / closed before connect
  • Subagent orphan run pruned ... reason=missing-session-entry

In at least one observed case, a Claude Code child process continued running after its wrapper/supervision chain disappeared and was reparented to PID 1. This suggests the runtime lost ownership of the child before stdout/update draining and completion handoff were fully finished.

This does not appear to require a plugin update or a gateway restart to trigger. The same error chain also appears in incident windows without a nearby restart.

Steps to reproduce

  1. Start a subagent or exec-backed child process that can continue emitting stdout near the end of a run.
  2. Let the parent run/session reach a completion or cleanup edge quickly, for example:
    • subagent completion
    • agent.wait
    • a run ending with stopReason=toolUse
    • a no-reply/completion path
    • session patch/delete/cleanup while child completion is still in flight
  3. Allow the child/supervisor to emit stdout or update events slightly after the parent active-run/session state has already been cleared.
  4. Observe that the runtime throws Agent listener invoked outside active run, then downstream subagent announce/resume/gateway behavior starts failing.

Expected behavior

If a child process emits late stdout/update events near the end of a run:

  • the runtime should drain those updates before clearing active-run ownership, or
  • safely ignore/drop late post-run updates without throwing

Subagent completion/announce should remain reliable, and child processes should not become orphaned.

Actual behavior

Late child/supervisor stdout reaches the runtime after the parent active run has already been cleared, causing:

  • Agent listener invoked outside active run

This then cascades into:

  • subagent announce timeout
  • websocket handshake timeout / closed before connect
  • Subagent orphan run pruned ... reason=missing-session-entry

In at least one case, the underlying Claude child process continued running after its wrapper/parent disappeared and was observed with PPID=1.

OpenClaw version

2026.4.5

Operating system

macOS 26.4

Install method

npm

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw->openai-codex/gpt-5.4

Additional provider/model setup details

Environment

  • OpenClaw 2026.4.5
  • macOS 26.4
  • launchd-managed gateway
  • local websocket/gateway traffic on 127.0.0.1
  • reproduced during real subagent + Claude Code workflows

Logs, screenshots, and evidence

2026-04-06T14:13:41.117+07:00 [openclaw] Unhandled promise rejection: Error: Agent listener invoked outside active run
    at Agent.processEvents (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:533:10)
    at file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent.ts:380:21
    at Object.onUpdate (file:///opt/homebrew/lib/node_modules/openclaw/node_modules/@mariozechner/pi-agent-core/src/agent-loop.ts:539:7)
    at emitUpdate (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1524:8)
    at handleStdout (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1546:4)
    at Object.onSupervisorStdout [as onStdout] (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1610:3)
    at file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:1007:21
    at Socket.<anonymous> (file:///opt/homebrew/lib/node_modules/openclaw/dist/exec-defaults-uj0McX2k.js:568:4)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:561:12)

Impact and severity

High severity.

User-visible impact:

  • subagent completions fail to announce reliably
  • websocket/gateway failures surface as abnormal closure symptoms
  • runs may appear lost or partially completed

Operational impact:

  • child processes can become orphaned and continue running without ownership
  • session/run state becomes inconsistent (missing-session-entry)
  • completion handoff becomes unreliable
  • long-running automation workflows become fragile around cleanup/completion timing

This looks like a lifecycle race in parent run/session cleanup versus late child stdout/update delivery. Even if local wrappers are hardened to reduce orphan symptoms, the upstream runtime sequencing issue remains.

Additional information

No response

extent analysis

TL;DR

The most likely fix is to modify the OpenClaw runtime to either drain late child process updates before clearing active-run ownership or safely ignore/drop late post-run updates without throwing errors.

Guidance

  • Investigate the Agent.processEvents function in @mariozechner/pi-agent-core to understand how it handles events outside of an active run and consider modifying it to handle late updates more robustly.
  • Review the handleStdout and onSupervisorStdout functions in exec-defaults-uj0McX2k.js to ensure they properly handle stdout events from child processes after the parent run has completed.
  • Consider implementing a mechanism to delay the clearing of active-run ownership until all child processes have finished emitting updates or a timeout has been reached.
  • Examine the error handling in agent-loop.ts and agent.ts to prevent unhandled promise rejections and ensure that errors are properly propagated and handled.

Example

No specific code example can be provided without modifying the existing OpenClaw codebase, but a potential solution might involve adding a check in Agent.processEvents to ignore updates that occur after the active run has been cleared, similar to:

if (!this.isActiveRun()) {
  // Ignore updates that occur after the active run has been cleared
  return;
}

Notes

The provided logs and error messages suggest a complex issue involving the interaction between OpenClaw, child processes, and the gateway. The solution may require modifications to the OpenClaw runtime and/or the child process handling code.

Recommendation

Apply a workaround to modify the OpenClaw runtime to handle late child process updates more robustly, as upgrading to a fixed version is not currently an option. This will help prevent errors and ensure reliable subagent completions and websocket connections.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If a child process emits late stdout/update events near the end of a run:

  • the runtime should drain those updates before clearing active-run ownership, or
  • safely ignore/drop late post-run updates without throwing

Subagent completion/announce should remain reliable, and child processes should not become orphaned.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Race condition in subagent/session cleanup causes late child stdout to hit cleared active run, leading to announce timeout, missing-session-entry, and orphaned child processes [3 pull requests, 3 comments, 3 participants]