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
- Configure a crontab entry (or a skill) whose agent spawns a subagent and then calls
sessions_yield to wait for the subagent to finish.
- Let the subagent finish normally.
- 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.
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 becausemaybeQueueSubagentAnnounceshort-circuits onisActive === false. The parent session stays idle forever and the scheduled work never proceeds.Steps to reproduce
sessions_yieldto wait for the subagent to finish.Expected behavior
Parent receives the subagent completion announce (as introduced by
fix: yield while waiting for subagent completions, commit42514156e0, andfix(subagent-announce): defer drain while parent session is busy, commit1841dd9977, PR #71706) and the crontab/skill turn proceeds.Actual behavior
The guard in
src/agents/subagent-announce-delivery.tsat around line 524 is:After
sessions_yield, the parent's embedded Pi run exits withstopReason: \"end_turn\"and is removed fromACTIVE_EMBEDDED_RUNS(seesrc/agents/pi-embedded-runner/runs.ts). At that pointisActiveisfalse, so the completion announce never entersenqueueAnnounceand theshouldDeferhook 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/mainHEAD6d31a42851(2026-05-10):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)— introducedshouldDefer, but did not remove theisActivegate for completion announces, so a yielded (inactive) parent still never enters the queue.f9eb7d993c fix(agents): queue subagent completion announces(2026-05-03) — added aforceCompletionQueueparameter that bypassed theisActivegate whenexpectsCompletionMessagewas set. This commit was present onorigin/mainon 2026-05-06 but is no longer reachable fromorigin/mainas of 2026-05-10 (6d31a42851). No revert commit is present; the branch appears to have been force-rewritten.isActivegate, none containf9eb7d993c):v2026.5.5,v2026.5.7,v2026.5.9-beta.1,v2026.5.10-beta.1.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
sessions_yieldwhile waiting on a subagent.Additional information
Last known good state:
f9eb7d993conorigin/mainon 2026-05-06 (never tagged into a release). First known bad release:v2026.5.5(first release combiningsessions_yieldwith the current completion-announce queueing code), still bad throughv2026.5.10-beta.1.