openclaw - 💡(How to fix) Fix [Bug]: crontab/skill parent hangs after subagent yield_session — completion announce dropped when parent is inactive [1 comments, 2 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#80310Fetched 2026-05-11 03:16:25
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

When a crontab or skill parent invokes a subagent and then yields (sessions_yield), the subagent's completion announce is never delivered to the parent because maybeQueueSubagentAnnounce short-circuits on isActive === false. The parent session stays idle forever and the scheduled work never proceeds.

Root Cause

Summary

When a crontab or skill parent invokes a subagent and then yields (sessions_yield), the subagent's completion announce is never delivered to the parent because maybeQueueSubagentAnnounce short-circuits on isActive === false. The parent session stays idle forever and the scheduled work never proceeds.

Code Example

if (
  isActive &&
  (shouldFollowup || queueSettings.mode === \"steer\" || queueSettings.mode === \"queue\")
) {
  ...
  shouldDefer: (item) => resolveRequesterSessionActivity(item.sessionKey).isActive,
}

---

src/agents/subagent-announce-delivery.ts:497   const { sessionId, isActive } = resolveRequesterSessionActivity(canonicalKey);
src/agents/subagent-announce-delivery.ts:524   if (
src/agents/subagent-announce-delivery.ts:525     isActive &&
src/agents/subagent-announce-delivery.ts:526     (shouldFollowup || queueSettings.mode === \"steer\" || queueSettings.mode === \"queue\")
src/agents/subagent-announce-delivery.ts:527   ) {
src/agents/subagent-announce-delivery.ts:545       shouldDefer: (item) => resolveRequesterSessionActivity(item.sessionKey).isActive,
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When a crontab or skill parent invokes a subagent and then yields (sessions_yield), the subagent's completion announce is never delivered to the parent because maybeQueueSubagentAnnounce short-circuits on isActive === false. The parent session stays idle forever and the scheduled work never proceeds.

Steps to reproduce

  1. Configure a crontab entry (or a skill) whose agent spawns a subagent and then calls sessions_yield to wait for the subagent to finish.
  2. Let the subagent finish normally.
  3. Observe that the parent never resumes; no completion announce is delivered.

Expected behavior

Parent receives the subagent completion announce (as introduced by fix: yield while waiting for subagent completions, commit 42514156e0, and fix(subagent-announce): defer drain while parent session is busy, commit 1841dd9977, PR #71706) and the crontab/skill turn proceeds.

Actual behavior

The guard in src/agents/subagent-announce-delivery.ts at around line 524 is:

if (
  isActive &&
  (shouldFollowup || queueSettings.mode === \"steer\" || queueSettings.mode === \"queue\")
) {
  ...
  shouldDefer: (item) => resolveRequesterSessionActivity(item.sessionKey).isActive,
}

After sessions_yield, the parent's embedded Pi run exits with stopReason: \"end_turn\" and is removed from ACTIVE_EMBEDDED_RUNS (see src/agents/pi-embedded-runner/runs.ts). At that point isActive is false, so the completion announce never enters enqueueAnnounce and the shouldDefer hook below never gets a chance to hold the item until the parent becomes idle. The function returns \"none\" and the parent is never resumed.

OpenClaw version

v2026.5.7 (also verified on v2026.5.5 and v2026.5.10-beta.1)

Operating system

Linux

Install method

npm global

Model

Claude Sonnet 4.6 on Amazon Bedrock

Provider / routing chain

openclaw -> amazon-bedrock

Logs, screenshots, and evidence

Relevant lines on origin/main HEAD 6d31a42851 (2026-05-10):

src/agents/subagent-announce-delivery.ts:497   const { sessionId, isActive } = resolveRequesterSessionActivity(canonicalKey);
src/agents/subagent-announce-delivery.ts:524   if (
src/agents/subagent-announce-delivery.ts:525     isActive &&
src/agents/subagent-announce-delivery.ts:526     (shouldFollowup || queueSettings.mode === \"steer\" || queueSettings.mode === \"queue\")
src/agents/subagent-announce-delivery.ts:527   ) {
src/agents/subagent-announce-delivery.ts:545       shouldDefer: (item) => resolveRequesterSessionActivity(item.sessionKey).isActive,

Git history:

  • 42514156e0 fix: yield while waiting for subagent completions — landed the yield flow.
  • 1841dd9977 fix(subagent-announce): defer drain while parent session is busy (#71706) — introduced shouldDefer, but did not remove the isActive gate for completion announces, so a yielded (inactive) parent still never enters the queue.
  • f9eb7d993c fix(agents): queue subagent completion announces (2026-05-03) — added a forceCompletionQueue parameter that bypassed the isActive gate when expectsCompletionMessage was set. This commit was present on origin/main on 2026-05-06 but is no longer reachable from origin/main as of 2026-05-10 (6d31a42851). No revert commit is present; the branch appears to have been force-rewritten.
  • Releases checked (all still have the isActive gate, none contain f9eb7d993c): v2026.5.5, v2026.5.7, v2026.5.9-beta.1, v2026.5.10-beta.1.
  • Post-drop related commits that do not fix this path: e74347bbe7 fix(agents): retry overloaded subagent announces, 335e5456d0 fix(agent): respect delivery status evidence, 1ed50b0ced fix: expose active-run queue failure reasons, 92284bc460 fix(agents): clean subagent fallback scaffolding (#78700).

Impact and severity

  • Affected: any crontab or skill-invoked agent that uses sessions_yield while waiting on a subagent.
  • Severity: High (blocks crontab/skill workflows end-to-end).
  • Frequency: Reproduces reliably; the gate is deterministic and unconditional.
  • Consequence: Scheduled/automated work silently stalls, requiring manual intervention to unstick.

Additional information

Last known good state: f9eb7d993c on origin/main on 2026-05-06 (never tagged into a release). First known bad release: v2026.5.5 (first release combining sessions_yield with the current completion-announce queueing code), still bad through v2026.5.10-beta.1.

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

Parent receives the subagent completion announce (as introduced by fix: yield while waiting for subagent completions, commit 42514156e0, and fix(subagent-announce): defer drain while parent session is busy, commit 1841dd9977, PR #71706) and the crontab/skill turn proceeds.

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 - 💡(How to fix) Fix [Bug]: crontab/skill parent hangs after subagent yield_session — completion announce dropped when parent is inactive [1 comments, 2 participants]